There's no question Morsi and the Islamic Brotherhood were elected democratically. They had the benefit of being the only organized opposition party, so of course they were best poised to win that election. The problem, however, is they didn't rule in that fashion. They changed the Constitution and attempted to change the courts and the military.
The result was that they had in practice the same kind of dictatorship they had under Mubarak, but much less free socially due to the conservative Islamic policies promoted by the Brotherhood. Furthermore, there had been a breakdown in basic social services and a collapse in the tourism industry, which resulted in an economic cratering and a food shortage.
The military has always served as the "grown-ups" in Egyptian politics. The question is how long they will continue to hold onto power before releasing back to the people. I think they're giving the people time to build political parties that can challenge the Brotherhood while also trying to shore up the economy. Let's hope this won't be another permanent dictatorship, like existed under Mubarak.