I think the reason he backed McCain is simple. He's not trying to back the "winning team" or be the VP, he wants his delegates to go to McCain as a final stake through the heart of Huckabee's campaign because, without Huckabee in this, Romney is probably the nominee right now.
If ole Huck doesn't rally religious nuts, Romney wins Iowa easily, and then takes the momentum to win New Hampshire, and it probably would have been all but over. Instead, Romney takes two "silvers" and his campaign nose dives. Even after that he probably feels without the Preacher man he would have had a good showing on Super Tuesday, and maybe turned it around. So I think it was all a big fuck you to Huckabee more than a desire to back McCain.
McCain didn't cost Romney the nomination, Huckabee did, so what better way to get even than to end all illusion of a campaign by throwing his delegates (the one's he can, anyway) to McCain?