MADRID — Spanish Prime Minister Pedro Sánchez’s Socialist Party took a beating Sunday in an election in Andalusia that saw the far right win seats in one of the country’s regional parliaments for the first time in decades. The Socialists (PSOE) — which have ruled the southern region uninterrupted for 36 years — came in first but could lose their grip on power if parties on the right team up against them. Juanma Moreno — the local leader of the Popular Party — said as the results came in that he would try to replace the Socialists’ incumbent regional leader,...