Almost certainly it is still locked to the original service provider in Spain. According to Apple's list, http://support.apple.com/kb/HT1937 all the official iPhone carriers in Spain sell phones locked, but do offer unlocking.
You will need to contact the carrier it is locked to, and ask them to unlock it (only they can unlock it). They can explain to you their requirements for unlocking, and how to proceed.
Once unlocked, you would need to get service and a SIM card for a UK network (you cannot activate it with your Spanish carrier's SIM because they have no network in the UK).