But there's an even weirder candidacy. That of Manuel Valls, former PM of France, to run for Barcelona mayor for Cs! Why would he do that? He has apparently participated in several unionist speeches and the like but still it's a really weird candidacy. Now, he is only considering, but the offer from Cs is there.
And yes, under EU law this would indeed be legal as any EU citizen can run and vote in local elections in whichever EU country they live in. So as long as he lives in Barcelona and registers, he would be ok. And he does have ties to Spain, after all he was born in Barcelona to a Spanish man (exiled in Paris because of the civil war) and had Spanish citizenship until 1982.
In France any EU citizen can run and be elected to city/town councils, but the top job (mayor) can only go to a French citizen. Isn't there such type of restriction in Spain?
It would be historical moment for the EU if it happens...