Roberts does know the law is unconstitutional, but it didn’t matter to him. His goal was to find a way to make the law stand in any way that he could, regardless of how ridiculous the legal logic was. He succeeded in the same way the OJ jury succeeded. He made a finding that made absolutely no sense given the information before him, because he could.
Roberts apparently agrees with the guy who appointed him.
When Roberts was nominated, he looked like an excellent choice. Who knew that he would turn out to be Neville Chamberlain reincarnated? He should know better than to think that appeasing a bully will solve any problems.
You just explained why he chose to write the majority oppinion. It would look a lot worse if Roberts didn’t try to exlain his vote.