All the players have made serious mistakes. The Muslim Brotherhood, on the basis of last year's 51.7 per cent majority for Morsi assumed it had the unquestioning support of half the population.
Many voted for Morsi in recognition of the Muslim Brotherhood's long resistance to six decades of military dictatorship. Others voted for him in gratitude for the Brotherhood's support for the poor, or in disgust at the fact that Morsi's only opponent in the second round was a leftover from the Mubarak regime.
Perhaps as few as half of them actually voted for the Brotherhood's core project of Islamising Egyptian law and forcing its own version of Islamic values on Egyptian society - but the Brothers seemed to think they all had.
Some of the constitutional changes Morsi imposed, and some of his tactics for pushing them through, may have been the result of political compromises within the Brotherhood, where he had to fend off the fanatics who wanted even more extreme measures. Nevertheless, the secular opposition parties inevitably saw him as an extremist, and genuinely feared that he would somehow manage to force the whole package on Egypt.
So the secular parties responded with extra-constitutional tactics of their own: mass demonstrations that were explicitly intended to trigger a military coup. In only four days of demonstrations, they succeeded, largely because the army, a resolutely secular organisation, had its own misgivings about where Morsi's government was taking Egypt.
But the army hasn't actually seized power. It has appointed Adly Mansour, the head of the Constitutional Supreme Court, as interim president, with the task of organising new parliamentary and presidential elections.
It will not be possible to exclude the Muslim Brotherhood from those elections without turning the whole process into a farce.
The Muslim Brotherhood took little part in the 2011 revolution, and the men at the top, including Morsi, were unprepared for power. They are now likely to be replaced by a younger generation who are more flexible and more attuned to the realities of power.
That's the real irony here. If the opposition parties had only left Morsi in power, his unilateral actions and his inability to halt Egypt's drastic economic decline would have guaranteed an opposition victory at the next election.
Gwynne Dyer is an independent journalist whose articles are published in 45 countries