Iran WAS an economic success. The Shah was one of America's most loyal allies, then Carter betrayed him for no reason at all.
Iran was a mess. The Iranian people hated the Shah and his secret police, and there was an active revolutionary movement that had broad support among the population. Moreover, radical Islam had already found its foothold there, before Carter abandoned Iran.
Carter certainly made things worse ... but he didn't create the problem.