Anyone who does not have the right to reside in Spain, such as non-EU Citizens, and even those who may reside here legally - such as EU citizens - may consider it preferable to make an application for citizenship.
Citizenship confers the right on the holder to reside and work – not just in Spain - but in any EU country. Also, citizens have the right to vote as well as the plethora of rights typically conferred on citizens of a country.
You may apply if you find yourself in any of the following groups: where your parents/grandparents or children are Spanish, if you have lived legally in the country for a period of 10 years or more; if you marry a Spanish citizen.
Please note that there do exist some special rules and limitations so you should discuss the matter with an immigration lawyer to make sure you are eligible.