You can take a UK registered car to Spain and drive it there for up to six months each year. If you want to stay longer, you should complete the import procedure (sometimes called matriculation or reregistering) and pay the appropriate taxes/costs for doing this. It's often more convenient to just buy a car locally.
Many people keep UK registered cars overseas for more than six months. It's easier to get away with this if you are travelling around or if you are in a larger city rather than in a smaller community. If you get caught breaking the rules, you could get the chance to take the car back to UK or you could have the vehicle confiscated.
To be legal, the car will need to be MOTed and insured at all times. Insurance is sometimes checked by customs officials but, because MOT certificates are not the same in every country, MOTs are checked less often. Some insurance companies will not give cover beyond six months in any year.
Google for "spain car import" for more links.
http://www.buypropertyspain.info/spanish_property_guide/tax_spain/car_tax.aspx
http://www.justlanded.com/english/Spain/Tools/Spain-Guide/Travel-Leisure/Importing-a-Car