[flagged]
The courts can intervene later, but they can't un-bomb a hospital.
This is setting aside the obvious problem where governments will often set laws based on self-interest rather than morality, particularly when it comes to military conflict.
See also the new national sport of hunting for fishing boats off the South American coast. Is that "lawful?"
And yes, since you went there: everything the Nazis did was "lawful." To the extent it wasn't "lawful," they made it "lawful."