Nate Oman makes an interesting analogy between the Turkish military (which sees itself as the guardian of Turkey's secular establishment and thus periodically overthrows democratically elected government seen as mixing Mosque and State too closely) and the US Supreme Court, which also adapts a countermajoritarian position towards democratic efforts to infuse religion into the political establishment. Though obviously there are important differences, both are non-elected institutions using their power to thwart the will of a democratically elected body.
Oman even argues that, if we look at it carefully, there are some advantages to the military taking on this role. While the legal training of a judge may make them better-suited to making fundamentally normative decisions about when to intervene against democratic decisions, Oman points out that judges are often rather impotent and cannot enforce their mandates. The Cherokee Indians of the 18th century, for example, would undoubtedly have preferred the US Army on their side rather than the US Supreme Court. If the Egyptian Supreme Court told President Mubarak that he didn't win his last "election," do we really think he would have stepped down?
Nonetheless, Oman concludes that "that the expectation of military coups breeds bad political habits, whatever its constitutional virtues might be." I'd add that when these sorts of decisions are made by courts, and the people accept them (as they didn't in the Cherokee cases, but as they have more recently in, say, the Warren era civil rights cases), it sends an important message about the political evolution of the state and the propensity of the people towards accepting rule of law. Because courts have no enforcement power other than their moral suasion, the very fact that they are obeyed is proof in of itself of a thick, robust commitment of the people towards living under our constitutional covenant. As a result, even though in both instances the democratic will is thwarted, only in the military example is the intervention truly coercive.