Germany said they’d curtail the use of U-Boats; the US’s contention was freedom of the seas which Germany agreed to, then reneged.
If the demand that Germany curtail its U-Boats was unreasonable to begin with, and if the U.S. kept shipping supplies to the Allies, then it was reasonable for Germany to renege on its agreement.
Israel often bombs neighboring countries to disrupt supply chains to terrorists within Israel.
If such actions by Israel are purely defensive and justifiable, then so too similar actions by Germany, or any other nation.