I firmly believe that Roberts makes his decisions based on how he wants “his” court to be seen by history, not based on the Constitution. Roberts does not want “his” court to be seen as conservative or liberal. As a result, he decides based on some messed up thinking about whether the Court has too many conservative or liberal “wins” as of that time and adjusts his position accordingly. His contorted reasoning on several issues, including Obamacare, I think supports that theory.
Chief Justice John Roberts also wants to maintain the independence and respect of the judiciary, an increasingly fraught proposition in an era when the Democrats threaten to stack the Court or worse if (realistically, when) they get power. So, throwing the liberals a narrow win in an important case from time to time preemptively stymies and distracts potential forthcoming attacks on the Court and ultimately helps conservatives.