Iran–the major geopolitical challenge in the Middle East–will view the military coup in Egypt as a net positive, on balance–though not without some downside. On the one hand, the ouster of the Muslim Brotherhood and Mohamed Morsi represents a victory over one Iran’s enemies in the Syria conflict, and a sharp blow to Sunni fundamentalism, which is competing with Shia fundamentalism for regional hegemony.
On the other hand, the Iranian regime can’t be happy when large groups of people come together to oust an authoritarian government, democratically-elected or otherwise. The difference in Egypt is that the military sided with the people; Iran’s military elite, the Iranian Revolutionary Guard Corps, is carefully cultivated and indoctrinated to support the regime. If that ever changes–and it might–then the Tehran regime is doomed.