here is my two cents...
last summer (june 25) i flew into barcellona. i was backpacking it. first night thought that i would see about a camp ground, and after they wanted nearly E30 for a night, i thought otherwise.
i was travelling with a hammock. found a couple of trees and strung it up. for the next four months of travelling around spain, i slept in me hammock. pretty much every night inside a city. anything from flag poles, bill boards, to chain link fences. never once was i bothered, never once was i asked to move on, zero problems from the police, zero problems from anyone. i was actually surprised how many other people where camping. pretty much every city i visited had the ruins of an old castle, usually on top of a hill near the center of town, with plenty of trees to string up a hammock. 99% of the beaches had showers, all with fresh water. i wasnt the only person washing their clothes and drying them with the mid day sun.
so if you really need to stay in a camp ground, fair enough. but personally, for spain, just find a good place, and camp for the night.