McCain lost because he was a deeply flawed candidate who was a self-described maverick whose campaign consisted of bashing his own party.
Yes, + economic meltdown + unpopular Bush-Cheney administration + the liberal pro-Obama propaganda from the MSM + dumbed-down electorate + conservative vote in the primaries split and divided between Thompson, Romney, and Huckabee.