Discussing the extremely harsh tone John McCain has taken against Barack Obama, Marc Ambinder notes, "The contempt that many McCain aides hold for Barack Obama rivals the contempt that McCain held for Mitt Romney a year ago."
...not to mention George W. Bush, who in 2000 McCain and his advisors viewed with even more contempt than Romney during the primary or Obama now. Notice the pattern here? The McCainiacs whip themselves into a moralistic frenzy against anybody who stands between them and the presidency.
And should that person subsequently become potentially useful in McCain's quest for the presidency (first Bush, now Romney), they can convince themselves that he's not so bad after all.
The psychological process that's operating here can be used to justify pretty much anything. In part it's a function of the hero worship cult that envelops McCain, which quickly leads its adherents to the conclusion that the very fact of running against the hero is proof of one's perfidy. This, I'm sure, is what allowed McCain to so easily smear Romney in the primary and to smear Obama now.