Sanford only supported McCain after he secured the nomination. I think you are mixing him up with Lindsey Graham's evil twin, Charlie Crist, the governor of Florida, who jumped on the McCain bandwagon when it became clear that Romney might have a chance otherwise.
From Wiki
Sanford certainly supported McCain in 2000.