Here is the official Spanish government link with advice in English and Spanish about the entry requirements for travellers from the UK to Spain. 

http://www.exteriores.gob.es/Consulados/LONDRES/es/COVID19-UK/Paginas/Requisitos-de-entrada-en-Espa%C3%B1a.aspx

 Update (8th June 2021) - you may also find this article useful: https://english.elpais.com/society/2021-06-07/spain-reopens-to-global-tourists-provided-they-can-prove-they-have-been-vaccinated-against-covid-19.html which was published on the 7th June and says "Visitors from the United Kingdom, meanwhile, do not currently need to present any coronavirus test results given the low incidence of the virus in that country thanks to its advanced vaccination campaign. That said, Spain is on the UK’s “amber list” of countries, meaning that arrivals to the UK from Spain must quarantine for 10 days on arrival, as well as taking a PCR test before travel and two home tests once quarantining."

 Please only use the above information as a non-official guide, and keep checking the official sources of information regularly prior to travel.