I was hoping for a deal that would verifiably dismantle Iran's nuclear program for the same reason that the deal was never in the cards: It'd be the end of Khamenei.
Khamenei can survive war. He can stand on top of the rubble of his nuclear program and claim that what matters is that he never caved to pressure, that he never gave in. He could, and will, claim that his program is minimally damaged and will be rebuilt. What he could not afford was looking weak, not by our standards, but by his.
Military weakness is bad. But these are Shi’ites who, in a few days, will be commemorating the defeat and death of their greatest martyr, Hussain ibn-Ali, against a much superior force. Shi’ites have internalized that they are oppressed, victims, and always the underdog. The struggle is perpetual.1
True weakness is that of the will. It is unforgivable.
If Khamenei ever made a deal that gave up his nuclear program, he would have caved to America, undermining the revolutionary slogan that "American cannot do a damn thing." He would have proven to be undetermined, a weak-willed man.
Instead, he can claim that this was a setback, whereas a diplomatic agreement that ended his program would have been a defeat, even more so if he gave up his program when he was losing a war.
Khamenei has a base of support between 10 and 20 percent. To stay in power, he needs to remain legitimate among that base. Undoubtedly, this setback harms his image and legitimacy. He will do his best to put a nice spin on it. Nonetheless, the message will be: “They can break our air defenses, but not our resolve.” The regime will argue that what matters is that the system survived, and the nuclear program is not dismantled, despite "American and Zionist propaganda." I cannot predict whether it will work with certainty, but my guess is that it will not. Determination can get you only so far, as Adolf Hitler learned the hard way.
There was no spin on giving up on his nuclear program willingly. Keep in mind: This is a zealous, religious regime carrying the will of God. In religion, compromising the will of God is a sin. How would his supporters react if he compromised on the will of God to the Great Satan?
Khamenei wanted to avoid a deal more than he wanted to avoid a bomb, and he got his wish.
This is a simplification of the Islamic Republic’s identity, to be clear. Rather, the Islamic Republic doesn’t have a coherent identity by design so that it can shapeshift according to the demands of the situation.