The Socialists won in Spain in 2004 in a fluke, as a result of the train bombing. The voters’ temper tantrum delivered them untold economic misery, not to mention raving leftist social policies.
Actually that is not true just a bit of nonsense that has been on FR for all these years - the PP always gets the majority of the votes for one party as the socialists are spilt 20 ways with all their parties.
So, to say the right were winning but lost the election is nonsense - they are always winning in the raw vote but the socialist all close ranks and make a coalition against them.
The people just did not like Aznar joining with Bush and Blair to invade Iraq. This was also compounded by the pair of them not inviting him to the meeting in the Azores after he put his Presidency on the line for them.
Everyone knew, except in America, that he was out regardless of the Madrid train bombing.
The fact that he was leading in the polls but lost is normal. In every election they have had since Franco the PP have always been leading in the polls but they need 51% to win.