Government advice is currently "From 27 July, the FCO advise against all non-essential travel to Spain, including the Balearic and Canary Islands, based on the current assessment of COVID-19 risks in the country." Quite how you determine this does not apply to those already in country on vacation I am not sure?
Because it says so two paras down?
From 27 July, the FCO advise against all non-essential travel to Spain, including the Balearic and Canary Islands, based on the current assessment of COVID-19 risks in the country.
This advice is based on evidence of increases in cases of COVID-19 in several regions, but particularly in Aragon, Navarra and Catalonia (which include the cities of Zaragoza, Pamplona and Barcelona).
The FCO is not advising those already travelling in Spain to leave at this time. Travellers should follow the advice of the local authorities on how best to protect themselves and others, including any measures that they bring in to control the virus.
https://www.gov.uk/foreign-travel-advice/spain