Roberst is not ignorant nor is he stupid, I think that he was asked to rule on a very narrow group of questions and for some reason, no one thought to ask if the whole thing was unconstitutionally passed.
The Supreme Court has three distinct factions: 4 liberals, 4 conservatives, and 1 moron.