You use the benefit of perfect hindsight, then adopting a particular consequentialist utilitarian framework and saying 'this is all there is to morality', but morality has multiple (often conflicting) objectives. I think denying that any conflict exists is really the essence of evil.
In the theatre of war, soldiers do not have perfect information or context. People who purposefully disobey orders generally put the lives of their own comrades and countrymen at risk.
Loyalty to your fellow soldiers and putting a measure of trust in them is moral. So is courage in the face of danger (in the case of admiral captain).
Even if we adopt your utilitarian framework, in the case of the U-boat attack, you are presupposing that the lives saved by allowing the rescue to continue will outweigh all the future damage and people killed in the future if that U-boat is allowed to continue to operate unimpeded. How do you know that's true? How would the pilot know in that situation?
In the case of the admiral, how we know his strategic choice was superior to the Admiralty's? It seems like you're assuming that he made the clear right move and was punished for it.
Note that they were ordered to attack despite that they reported survivors on board. Attribute the cowardice and bloodthirst appropriately in the command chain.
The reason it's not accepted is because it's too difficult to discern if it's a lie in order to (attempt to) avoid punishment.
Following an order to attack an enemy in time of war, when you'll probably die for not attacking them ... if you knew for certain the enemy wasn't trying to trick you, and were genuinely saving civilians, then of course you should disobey, ... maybe ...
Even if that particular captain was saving civilians, it may still ultimately save lives to sink the enemy ship; that's the "glory" of war. Taking a pragmatic approach then, sinkng the ship can be considered "moral".
Indeed taking such an a priori callous action could require a degree of bravery.
In 1757, the British admiral John Byng was executed for failing to sail his ships into a storm. The enemy was besieging a fort, and although Byng engage the enemy fleet he didn't pursue and annihilate them - heedless of the danger - and thereby the relief troops were unable to reach the fort before it fell. This was considered a capital offensive despite being sound strategy (the loss of the fort was bad, the loss of Byng's fleet would've been crippling) - making the right call got a man shot by firing squad.
These two incidents are always in my head when people discuss morality or honor or any such topics. The truth is "moral" for most people means nothing so much as "Did a thing I like" and immoral means "Did a thing I didn't like". That B-24 crew attacks the enemy, which is good and therefore moral - that it was a supremely cowardly and bloodthirsty thing is irrelevant.
It's just how people are, I suppose. Well, most people. Some are genuinely good eggs, and those are the ones to befriend.