Since Billy Budd is set in the wake of the Nore Mutiny, a sense of military duty is not just a formality; it is a safeguard against massive uprisings in the British fleet. Duty often allows one to act thoughtlessly and simply follow orders, but in Billy Budd one's sense of duty becomes a true burden to carry. As the characters try to sort out difficult moral questions, it is unclear whether they are serving a higher obligation by doing their duty or simply hiding behind it. The story is nuanced enough that there is room for plenty of debate.
Captain Vere is motivated less by a sense of military duty than by fear that the failure to execute Billy would spark an uprising against him.
Captain Vere tries to simplify his dilemma by speaking of military law in terms of duty but also by refusing to speak of natural moral obligations in terms of duty.