Martial law is not illegal and has been declared numerous times in US history, War of 1812,Coal Field Wars, San Francisco 1906 earthquake, Hawaii was placed under martial law in 1941, 8/26/2005, in the wake of Hurricane Katrina in New Orleans ,Great Chicago Fire of 1871. However the reasons martial law can be declared generally breakdown to the inability of the local government to provide law and order and/or essential services.
If martial law was to be declared, people would turn violent and start fighting with each other. This is because the martial law is an illegal law and anybody who would follow it, would be termed guilty of treason. The martial law would also bring up dictators who would have the power to do anything they want.