A duty to whom? In most armies and wars, insisting to refuse an order, moral or not, will get you in front of a firing squad (or, if it's a really civilized army, in jail).
I kind of see their point - under this defense, the only person you could really convict would be Hitler (everybody else was following orders). I'm guessing the logic here is that if you were for example a commander a Nazi death squad that was doing mass murders of Jews in Eastern Poland, then yeah, you were following orders, but you could have also asked to be transferred to something else.
I'm not sure this logic would hold for Soviet genocides though (not that they were tried at Nuremberg), as I suspect a hint of hestitation from say NKWD commander would probably result in him being promptly sent to Gulag to die. During Stalin's rule, pretty much everybody was operating with a gun to their heads at all times.
I think the logic during the trials was that even if disobeying orders meant punishment such as torture or death, that was preferable to committing the crimes for which they were standing trial.
As in, your potential death or suffering at the hands of your superiors is also not a credible defence for what you did.
That obviously makes a lot more sense in the context of war crimes and crimes against humanity though.
Well, it does depend on the army, I admit. And "immoral" was probably not a good term. More like "an order that seems to violate policy". But following illicit orders can also get you in trouble.