The cause of it is putting wrong people on wrong positions: Corruption, nepotism, famil-bazi/tribalism. That can only happen if corrupt pro-nepotism figures rule the country (Shamkhani, Rouhani, Ghalibaf and 40 other thieves). The hero is not born yet, to clean up the country from roots.
We know Khamenei is Not Sasan, Not Shapur the great, Not Cyrus the great, Not Darius the Great, Not Nader, Shah Abbas, nor Amir Kabir or even Reza Shah.
He has no "tokhm" and no vision to wipe out corruption and nepotism. He's acting more like an abbasid caliph, being puppet of greater or surrounding forces and watching Iran being harmed and eaten by locusts and leeches. He's not a player, he's played. This is the fact untill now and I don't see how it will suddenly change at his age.