First of all, the purpose of the Iran Nuclear Deal was to prevent Iran from getting the bomb without having to resort to a full scale military confrontation.
Don’t forget that before negotiations the US engaged in massive intelligence and sabotage efforts to thwart the program and only managed to slow it down, not stop it. So if further nuclear proliferation is a red line, then military action is the only option left on the table.
However, it seems that the regime dispersed the effort in many secure locations and couldn’t be taken out with a surgical strike like the Israelis took out Saddam’s nuclear reactor. So if a limited military action was viable, Obama would have probably taken it. It’s not like he was shy when it came to involving US troops in foreign wars.
Which brings us to the second problem - full scale military engagement. Beside the fact that there ten times more Iranians than Iraqis, the former can and will fight. In the Iraq-Iran war Saddam couldn’t defeat the new regime at it’s weakest, despite having the best equipped Arab army and liberally using chemical warfare agents against human waves of Iranian fanatics.
Although Iranians proper are not that effective on foreign soil - the regime had to resort to press ganging Afghan migrants as cannon fodder in Syria to save as much as possible precious Revolutionary Guardsmen - when it comes to fighting on home turf the fanaticism dial is turned to eleven, using both religious fervor and the rich history of an empire that used a captured Roman Emperor as a living stool.
Even the most ardent opponents of the regime in Iran lose their shit on the anniversary of the battle of Khorramshahr in which a vastly outnumbered detachment of Iranian marines, soldiers and policemen held off two Iraqi armored divisions, destroying hundreds of tanks.
So any military action would result in a quagmire of all quagmires because unlike Iraq and Syria you couldn’t recruit an oppressed ethnic minority to help in the fighting.
In that sense, the Deal was a triumph of diplomacy, especially when the US and allies had to deal with a culture pathologically obsessed with the loss of face and under constant pressure from hardliners who were itching for the final reckoning with the Saudis.
Sure, nasty compromised were made, including turning a blind eye to Hezbollah money laundering and arms trafficking schemes, among other things but it was the best deal available and per IAEA Iran was respecting it until Trump unilaterally withdrew from it