What law are you talking about ? Last time i saw military overthrew a legitimate government. There is no law under one man show so welcome to dictatorship again my friend.
The illegal constitutional decree released by none other than Mohammed Morsi:
Article I:
Reopen the investigations and prosecutions in the cases of the murder, the attempted murder and the wounding of protesters as well as the crimes of terror committed against the revolutionaries by anyone who held a political or executive position under the former regime, according to the Law of the Protection of the Revolution and other laws.
In reality none of those accused of murder during the revolution were found guilty or convicted. Partly due to the chief prosecutor Morsi appointed (more on that later).
Article II:
Previous constitutional declarations, laws, and decrees made by the president since he took office on 30 June 2012, until the constitution is approved and a new People’s Assembly [lower house of parliament] is elected, are final and binding and cannot be appealed by any way or to any entity. Nor shall they be suspended or canceled and all lawsuits related to them and brought before any judicial body against these decisions are annulled.
Goodbye separation of powers. This article alone would result in the impeachment of any president/prime minister in any democracy.
Article III:
The prosecutor-general is to be appointed from among the members of the judiciary by the President of the Republic for a period of four years commencing from the date of office and is subject to the general conditions of being appointed as a judge and should not be under the age of 40. This provision applies to the one currently holding the position with immediate effect.
Interference in judicial matters. Goodbye independent judiciary (or even the notion of one). The prosecutor general (or chief prosecutor same job) would normally only be appointed from within the judiciary and their removal can only happen by judicial order. The prosecutor appointed was the prime reason those accused of murder in the camel events 2011 were found innocent as he failed to deliver the required evidence to convict them.
Article IV:
The text of the article on the formation of the Constituent Assembly in the 30 March 2011 Constitutional Declaration that reads, "it shall prepare a draft of a new constitution in a period of six months from the date it was formed” is to be amended to "it shall prepare the draft of a new constitution for the country no later than eight months from the date of its formation."
This assembly was disastrous but that's another matter entirely.
Article V:
No judicial body can dissolve the Shura Council [upper house of parliament] or the Constituent Assembly.
Given the constitutional court was about to dissolve the council (unelected council full of Islamists, military men and little else) Morsi decided to illegally save it.
Article VI:
The President may take the necessary actions and measures to protect the country and the goals of the revolution.
Disastrous article which basically gave him every single power in the country (more than Mubarak).
Article VII:
This Constitutional Declaration is valid from the date of its publication in the official gazette.
‘Egypt’s new pharaoh: Mohammed Morsi criticized for seizing new powers | National Post
Five people died as a result of protests against his rule and many more were injured and tortured (including the former ambassador to Venezuela).
So without a representative house in Parliament (the only house that could impeach the President) Egyptians had no other choice but to take to the streets to call for the downfall of the regime. The regime actually fell on the 30th with loads of ministers, consultants and governors resigning. All the military had to do was apply the sword.
Morsi's legitimacy ended the day he released that decree.