Lol, yes it will, in certain countries like Turkey or Greece for example.
There's no way it will work in Western Europe or America.
So I doubt it will work in Spain.
You could give it a try though, but I doubt it, because the UK's IMEI blacklist is quite strong.
This is illegal, but your best bet is to change the IMEI of the iPhone if you intend to use it in Spain.