There is a risk here of confusing taxation legislation and the requirements for paying social security as pointed to in the above link.
The two are different.
On tax if you have to pay in Spain this will be credited against your UK liability (there is a double taxation treaty as with most Eu countries) and so broadly speaking you won't be any worse off....just more paperwork!
As always no substitute for professional advice.
Binder