score:6
After Madrid al-Qaeda attacks in which bombs were connected to mobile phones, new law has been passed. Each and all phone lines have to be registered to a person using it. Which means that in practice, buying any SIM, including pre-paid ones, requires you to present identification and valid address in Spain.
That being said, you shouldn't have any problems at all buying the SIM once you're already there. Even at the airport.
Current (summer 2012) comparison of the pre-paid cards.
Vodafone, Movistar, Orange are major providers, which have their SIM cards sold everywhere. Yoigo and Simyo are quite major MVNOs and also should be easily available. Many others are tied to supermarket chain, social network etc.
Upvote:2
There's a US company called Cellhire which offers a 10GB data bundle for Spain for $99 a month and that includes a USB modem rental. I think they also do those Mifi travel router things which can be handy if you want your laptop AND phone to hook up to the data. There is a $19 setup fee but that covers them shipping it to your home and back again. Like me, it sounds like you prefer the reassurance of something in your hands before you travel. If so then give them a go - they're pretty trustworthy.