It's not legal at all !! I actually love some of the graffiti and have photographed it many times in Spain . The artwork is sensational and really cutting edge . Generally the graffiti is done by young people .... a sort of anti government thing ... In Madrid there are great examples down by the river Manzanares in Arguelles .. by the railway tracks . Where I was living in Barrio Salamanca there is a park called Fuente del Berro where you can see beautiful graffiti going towards the Plaza de Toros . I actually published some of my photos on flickr.com and have had some good feedback !
What I DON'T like is graffiti on historical buildings and private houses ... THAT is vandalism and , if caught , the perpetrators should be prosecuted .
Graffiti has been popular for centuries , with many ancient buildings having initials and messages carved into their walls .. The new style of graffiti is colourful and should be considered as an art as long as it does not destroy ancient or important buildings .
The graffiti artists have to respect that their work is art but that a 17th century building ( for example ) in Madrid is ALSO a work of art . The graffiti artists should have respect for the community AND for fellow artists , ancient and new !