The British Embassy in Madrid said back in June that UK residents' right to vote in town hall elections in Spain still stood, even after Brexit.
Uncertainty arose following a recent ruling by the EU's top court that Britons in France could not vote in local elections or stand as local councillors after Brexit as it was up to France and not the EU to extend that right, which was lost to British citizens there when the UK left the EU.
The embassy's Brits in Spain Facebook page stated that, unlike in France, the UK and Spain had already reached a deal giving UK residents the right to vote for local councillors or stand in town hall elections even after Brexit.
The message said that - unlike before Brexit - a Briton needs to be resident in Spain for a minimum of three years first, and, as before, be registered on the municipal register where they live (padrón municipal). In addition they should confirm registration on the town hall electoral roll (censo electoral) within the dates set by the electoral authorities before each election. (December I think)
For more information: gov.uk/livinginspain#voting