Spaniards have to carry ID at all times. They have a little card that has their photo and a scanned version of their fingerprint.
Foreigners, like us, living in Spain have an ID number. Its format differs slightly from the one for Spaniards. It's called an NIE.
Getting the NIE number is dead easy, a bit of form filling and a queue. The next step, once you've been in Spain for at least 6 months is to get "resident" status. There are legal implications but basically for most Brits it means they get an ID card, which everyone calls a residencia, that looks just like the card Spaniards carry. It is recognised everywhere for guaranteeing credit cards, receiving registered mail etc.
Maggie and I tried to get a residencia last summer and we were turned away being told there was no need for us to have one. As EU citizens the NIE gave us everything we needed. Unfortunately as the NIE is just a piece of paper, without a photo, it doesn't serve as a form of identification so we had to continue to carry our passports around. The last time I looked it cost 121€ to get another passport if it were lost or stolen.
So we paid a solicitor to start the process of getting us a residencia. Comfirmation of our status as resident came last October but my appointment to get my fingerprints done to produce my photo ID card was today.
I dutifully went and queued for five hours to get the card. It's a long and boring story but the gist of it is that some interfering European Rights types have made Spain stop it's discriminatory practice of dealing with other EU nationals differently to Spaniards. So they no longer issue little cards (what the three other Brits around me in the queue and I all wanted) and have replaced it with another sheet of paper which proves our resident status but is valueless as a form of identification. The new system started just this month so we missed our cards by ten days.