While some of his shifts may be an attempt to "grow" and "refine" his positions, many of his flip-flops were calculated moves to "placate the GOP right" in the course of his run for president:
TAXES: In 2001 and 2003, McCain opposed the Bush tax cuts, saying that they would "mostly benefit the wealthy." But in 2006 he voted to extend them and now he wants to double them.
IMMIGRATION: In 2006, McCain sponsored immigration reform legislation with Sen. Ted Kennedy (D-MA), but in a January 2008 debate, he said that he "would not" vote for his own legislation.
ROE V. WADE: In 1999, McCain told reporters that he "would not support repeal of Roe v. Wade." In 2006, McCain expressed his unequivocal support for overturning the decision.
OFFSHORE DRILLING: In 1999, when he first ran for president, McCain supported the moratorium on offshore drilling. In June 2008, however, he called for an end to the federal ban on offshore oil drilling.
RADICAL RIGHT: In 2000, McCain declared Pat Robertson and Jerry Falwell "agents of intolerance," but in 2006 McCain said he no longer considers Falwell an "agent of intolerance."
In reality, it seems like McCain is the one who drank the Kool-Aid about his own maverick persona.