Resulting from a discussion on a forum:
Hmm, this makes an eerie sort of sense: when McCain was stuck in a Vietnamese prison camp, he made a deal with the devil; he would get out, return to the US, become rich, marry a beautiful woman, have a successful career in politics, and eventually become President of the USA. For this, he surrenders his soul.
Now that he is at the end of his life, he suddenly realizes what an enormous mistake he made. Although he cannot give up on the deal directly, he is actually doing everything he can to tank his own campaign, so the Devil's promise remains unfulfilled and McCain's soul is redeemed.