The information below is taken from the UK government website.
Passport validity
Your passport should be valid for the proposed duration of your stay; you don’t need any additional period of validity on your passport beyond this. This applies to the whole of Spain, including the Canary Islands and the Balearic Islands (Majorca, Menorca, Ibiza and Formentera)”.
“If your passport describes you as a British Citizen or a British Subject with Right of Abode in the United Kingdom, you don’t need a visa to enter Spain. If you have another type of British nationality, you should check entry requirements with their nearest Spanish Embassy or Consulate”.