“I was just following orders.”  “I was only doing my job.”  “I had a legal obligation to act.”  The most self-righteous criminals often invoke fiduciary obligations to explain why their actions were morally required rather than morally forbidden.

Mike Huemer, guest blogging at Open Borders, offers a succinct general refutation:

[H]aving special duties to A does not cancel your ordinary
duties to B. Let’s say you have special duties to your daughter. You
have to provide for her needs in a way that you don’t have to provide
for a stranger’s needs. This doesn’t mean that, when you have children,
somehow your obligations to everyone else (or everyone to whom you don’t
have some special relationship) are canceled. You can’t now abuse
strangers to your heart’s content, just because they’re not your
daughter. For example: if your daughter is cold, you should buy a jacket
for her, before buying one for your neighbor’s daughter. But you may
not steal a jacket from your neighbor’s daughter to give it to your own
daughter.
Similarly, the state’s special duties to promote its own citizens’
interests, even if we believe there are such duties, do not negate the
rights of non-citizens, nor do they mean that the state may abuse
foreigners to its heart’s content as long as doing so serves the
interests of citizens.

Bottom line: You shouldn’t enter agreements to perform morally impermissible acts – and if you ever reach a point where a prior agreement requires you to perform a morally impermissible act, you should break your agreement.