Hello Tourist!!!
It is not possible to get a job in Spain without being in a legal situation.
To live in a legal position in Spain a foreigner needs a residence permit which can be for provisional (for more than ninety days and less than five years) or permanent residence (unlimited). To obtain a permanent residence permit a foreigner must have lived in Spain for five years (continuously).
To obtain a residence permit the applicant needs to be in one of the following positions: S/he intends to stay in Spain without being economically active, proves to have enough economic means available to provide for food and lodging expenses and, when applicable, those of her/his family; s/he intends to carry out an economic activity as self-employed; s/he has a work offer and intends to carry out an economic activity as a salaried employee; s/he has the right of family reunion. S/he also needs to demonstrate absence of criminal record in Spain and in the previous residence countries for facts which are considered crimes in Spain.
A permanent residence permits entitles a foreigner to enjoy the same work conditions as a Spaniard. With possession of a residence permit a migrant is in the position to enjoy all the rights and freedoms recognised in the Law 8/2000, which amended Law 4/2000, on the Rights and Freedoms of aliens in Spain and their social integration, among them the right to education, to medical aid and to assistance for housing. A crucial point of the emendation of Law 4/2000 is that only foreigners in a regular situation can enjoy all these rights, the same way a Spaniard does. Foreigners who don’t have a regular residence permit have limited rights. In particular:
Education: article 27 of the Spanish Constitution affirms that everyone has the right to education. The aim of this provision is to enable the full development of the human personality in respect for the democratic principles of coexistence and the basic rights and liberties, without mentioning any difference between Spaniards and aliens. On the other hand, Article 9 of the Law 8/2000 however states that all foreigners, independently on their legal situacion, just have the right to the basic compulsory education.
Health care: in emergencies, all foreigners (including those who do not have a permit of stay or residence permit) have access to the emergency public health care, until the patient is discharged. Pregnant women have access to health care systems during pregnancy, birth and during their lying-in.
Assistance for Housing: it is recognised only to foreigners with a regular residence permit. For foreigners who are not in a regular position there are government-established temporary residence facilities (CETI: “Centro Estancia Temporal de Inmigrantes”, The Center for the Temporary Residence of Immigrants) where they should have access to food, water, sanitary facilities, or medical care. They usually host refugees or asylum seekers which are waiting for a regularisation of their status in Spain. Documented sources, however, report that advertisements concerning rental of private property sometimes exclude certain categories of persons, such as Roma/Gypsies or foreigners, from applying. It has also been reported that, when property is actually rented to these categories of persons, discriminatory conditions, notably higher rent, are in many cases applied to them.
Social Security and social services: only foreigners in a regular situation have the right to Social Security and social services under the same conditions as Spaniards; all foreigners have the right to basic social services and benefits.
(More info in lawyerinspain dot com) very useful