From the US/Israeli perspective, it's hard to trust Iran, which is positioning itself as a threshold nuclear state, and may attempt to secretly cross that threshold at any time (as North Korea did).
From the Iranian perspective, the government is fearful of infiltration and overthrow, as well as outright invasion, remembering that non-nuclear states have been undermined by the USA and allies (as happened in Libya).
There were ongoing negotiations which unsurprisingly have now ended.
There are no clear indications Iran was in breach and they levels of enrichment were allowed by the terms. Although that was part of the point of the negotiations which the US wanted to raise.
Iran has not earned much trust with anyone either; they’ve been supporting the Russian aggression in Ukraine (where nuclear strikes have been repeatedly threatened), as well as sponsoring non-state actors which have attacked the USA and Israel.
But, Iran is still legally bound by the NPT and IAEA safeguards, which require transparency around nuclear technology with the other parties who remain.
Prior to Israels attacks there were also indications the US was about to re-enter negotiations. That went up in smoke and likely motivation of the attacks.
> Finds that Iran’s many failures to uphold its obligations since 2019 [...] constitutes non-compliance with its obligations under its Safeguards Agreement with the Agency
[1] https://www.iaea.org/sites/default/files/25/06/gov2025-38.pd...
As Israel did.
There might still be room for diplomacy and reentering IAEA. But since Iran leaving the IAEA strengthens their bargaining position this is a logical move for them.