Actually, just commenting on this, the government has legal footing to do this, following a strict reading of the relevant laws.
The relevant constitutional article is article 116 (“1. Una Ley orgánica regulará los estados de alarma, de excepción y de sitio y las competencias y limitaciones correspondientes.” – “1. A special law will regulate the states of alarm, exception and siege, as well as their corresponding limitations and competences”).
Article 116 is governed by law 4/1981 (June 1st), which says, among other things:
"Artículo 4.
El Gobierno, en uso de las facultades que le otorga el artículo 116.2 de la Constitución podrá declarar el Estado de Alarma, en todo o parte del territorio nacional, cuando se produzca alguna de las siguientes alteraciones graves de la normalidad:
a. Catástrofes, calamidades o desgracias públicas, tales como terremotos, inundaciones, incendios urbanos y forestales o accidentes de gran magnitud.
b. Crisis sanitarias, tales como epidemias y situaciones de contaminación graves.
c. Paralización de servicios públicos esenciales para la comunidad, cuando no se garantice lo dispuesto en los artículos 28.2 y 37.2 de la Constitución, y concurra alguna de las demás circunstancias o situaciones contenidas en este artículo.
d. Situaciones de desabastecimiento de productos de primera necesidad."
That is (emphasis mine):
"Article 4.
The Government, using the powers given to it by article 116.2 of the Constitution, can declare the State of Alarm, in all or part of the country, when the any of the following serious disturbances to normality happen:
a. Catastrophes, calamities or public disasters like earthquakes, floods, urban and forest fires or extreme accidents.
b. Sanitary crisis like epidemics or serious contamination incidents.
c. Paralyzation of public services essential for the community, when the contents of articles 28.2 and 37.2 of the Constitution have not been followed, and whenever any of the other circumstances or situations mentioned in this article happen at the same time.
d. Situations where there is a lack or shortage of essential products."
The relevant point here is point c. The government published a note saying that they were declaring the state of alarm in base to this law, according to point c, and considering that points a. and d. were applicable.
They have done this after consulting with the constitutional judges, so I am sure that they have a legal justification behind this that will be more in-depth than whatever I might say here.
Point c is a given: Air trafic control is a public service which has become essential for a modern nation, and article 28.2 of the Constitution has not been followed (it is the one that grants a right to strike provided that you give proper warning and follow the forms). The tricky aspect would have been to show that any other of the situations in points a, b or d may apply.
I don’t know about point a. It seems like over-stretching, unless they were thinking of the weather situation at the time. Point d is on much more solid ground, if you either define “maintaining air traffic open” as an “essential product” in a modern society, or consider that air traffic is the only way to do essential things like making sure that (for instance) an organ for a transplant reaches its destination in time.
In any case, this decision was taken after first checking with the relevant constitutional judges, who I am sure know much more than me about what can or cannot be done, or what can be considered to be grounds to declare a state of alarm.
The point is that a State of Alarm can only be declared by agreement in the parliament, after a vote, and the current government has only a plurality, not a majority of seats in the parliament. They needed (and received) the support of the opposition for this. It would appear that the opposition agrees with the legal reasoning that the government had to provide in parliament for the State of Alarm to be declared. It appears that there was a perception (at least in parliament) that the situation was dire enough to merit this.