McCain almost pulled it off actually. Palins pick was brilliant politics. The Republicans were soaring for several weeks.
The financial meltdown was the decisive factor, it ended all their momentum. It didn’t help that McCain handled his response to it very badly.
Remember the meme that circulated before the meltdown that McCain might win the pop. vote and lose in the EC and/or if 0bama lost it was due to racism? He had a puncher’s chance, but the mega-trends were against him.