By the way, if Obama was really a Muslim he'd be a Sunnite - therefore the first thing he would have done upon taking office would be to launch strikes against Shiite idolatrous apostates that corrupted the Word of God.
Probably the latter. First of all, sufficiently stable (that means brutal) dictatorships play the long game and try to exploit the natural lifecycle of every democratically elected government against them, including the US administration.
During the Ahmadinejad years the Iranian regime bet everything on a single roll of the dice - getting the bomb. They'd hoped that they'll be able to complete the bomb before the crippling sanctions completely destroyed the economy.
For a myriad of reasons, probably the major one being active US intelligence/covert countermeasures, they failed and realized they've pushed themselves in the corner. And for a brief terrifying (for the Iranian ruling elite) a military option was on the table for the US, not helped by Ahmadinejad's outrageous statements in the international arena, painting him as the stereotypical villain.
So they decided they needed to back down - hence the Nuclear Deal. Now, negotiations with the Iranian regime were bound to be difficult - if we ignore for the second the hardline religious element and fierce nationalism, the Iranians can be pretty exasperating. They're often on the verge of hysteria, constantly worrying about "losing face", "honor", "giving one's word" etc. Unlike the Arabs in general, they pretty much believe in that stuff.
But they're smart. Really smart. Now, I'm speculating that somewhere in the early stages of this delicate balancing act of negotiations the Obama administration pretty much telegraphed them that they're really interested in closing the deal during Obama's tenure (see the first paragraph about exploiting the lifecycle of an administration). Was it because the Sunnis (ISIS) were the primary concern for the US or because the relationship with the Sunni superpower Saudi Arabia hit a rocky patch, who knows?
Anyway, this is the part where the Obama's administration messed up.
So the Iranians probably started exploiting this, especially since Kerry was a horrible SoS, allowing pretty much everyone to impose their will on him. So they started asking for concession after concession (including freeing their agents, cancelling Interpol warrants) under the plausible (and partially true) explanation that they'll have a hard time selling the Deal to their hardliners.
And not used to the exhausting and complex concept of such negotiations the administration caved in on many points. Rank amateur stuff, I gotta say. As the negotiations progressed, the Administration got carried away and became inpatient so they started conceding ground left and right, as it was nicely summed in the Politico article.