I'm not a lawyer, but I have done a lot of research on the writing of the Constitution and its implementation in the early years of the Republic. II also think I know a little about politics.
While I have no way of knowing whether the Chief Justice in fact holds any of the views I will ascribe to him, I suggest these hypotheses as highly plausible.
-- Roberts recognized growing criticism of the Court for partisanship and welcomed a way of reducing those attacks.
-- He was personally opposed to the Affordable Care Act but recognized the weight of judicial precedents in favor of its constitutionality.
-- He found, and occupied, a clever middle ground that gave both liberals and conservatives much that was pleasing to them.
-- For the conservatives, he opposed the validity of the individual mandate under the Commerce Clause and opened the door for later challenges to social legislation under it; he also took a more restrictive position on Medicaid and its burdens on the states.
-- For the liberals, he upheld the basic law under the congressional taxing power.
-- Cleverly, Roberts got the court to say that, though the law was a tax, it was not subject to the 1867 Anti-Injunction Act preventing judicial review of taxes until they are actually collected.
Deft work, Mr. Chief Justice.
UPDATE: I see that a legal analyst also finds evidence in the wording of the opinion that there was some back room maneuvering. And Ezra Klein makes some points similar to my own.