We don’t know what changed his mind.
I have wondered if he ultimately decided to take the ultra-conservative stand and reject judicial activism, refusing to legislate from the bench.
In essence, what Roberts did was hold elected representatives responsible for passing a terrible piece of legislation (which he alludes to in his opinion), bounce it back to them to clean up their mess, but also give them a way to reverse their mistake by ruling the mandate a tax, a budgetary item. which can be repealed with a simple majority.
He also slapped down fradulent use of the Commerce Clause, as in Wickard vs. Filburn, bolstered states 10th Amendment rights with the Medicaid ruling, and handed the Romney campaign a boatload of good campaign material.