Iran has been waging war since the Islamic Revolution and the US claims that there was a threat of attack on US bases and US interests and therefore the attack was in self defense. The body that decides is the UNSC and given the US has veto powers it's not going to obviously declare the US attack illegal.

From Israel's perspective there's an even stronger self defense argument given the amount of missiles aimed at Israel from Iran and the enrichment of nuclear material to military grades while constantly threatening the elimination of Israel. So the US argument that they knew Israel was planning the attack and they knew Iran would retaliate against US interests seems at least on the surface to bad valid.

> the US claims that there was a threat of attack

What the US claims is really not a strong source of anything, and I'm saying that as an American. The most compelling reasoning is that Israel was going to do something so US decision makers decided joining was the best worst decision, and I'm being very bend over backwards generous with that. Anything else is just excuses trying to cover it up. It seems obvious now that there was no stopping Israel from their strike on Iranian leadership. It was too ripe of a target, they have been emboldened by current US admin, so at that point it was in for a penny, in for a pound mentality.

If the US thought an Iranian retaliation from an Israeli strike would be to attack US assets, then the world would possibly have some sympathy. No rational person could condone an outright first strike just because we thought something was going to happen. Yet the fact that in the "we think they will do something" spit balling never suggested shutting the down the strait seems very suspect as well.

> If the US thought an Iranian retaliation from an Israeli strike would be to attack US assets

A reasonable belief, because Iran in fact responded to the US+Israeli strikes by attacking US allies and even neutral nations like Qatar.

> the enrichment of nuclear material to military grades while constantly threatening the elimination of Israel.

Iran has supported a treaty on elimination of weapons of mass destruction in the middle east, Israel has been the blocker of it, only actor in the region that has nukes, and isn't in the NPT.

As a non-signer of the NPT, military aid to Israel is also illegal under US law, so we play along with strategic ambiguity and pretend they don't have them.

>Iran has been waging war since the Islamic Revolution

On who?

At various times, and potentially via proxies: Iraq Saudi Arabia Israel Kurdish Rebels The US “All countries” via actions against shipping in the Red Sea and the Strait of Hormuz

They've colonized the whole region with their proxies, from Lebanon to Yemen to Iraq, previously Syria which they attacked with Hezbollah to support the Russia-backed Assad. About 1 million dead people from all this proxy warfare. Lebanon in particular wants to be a normal liberal democracy but their proxy militia assassinates any politician who stands in their way.

How many dead from the US's proxy wars?

This is irrelevant to the topic at hand. Not dismissing your point, but it's really not a useful follow up. The two things can be bad at the same time.