That determination was not his to make.
Even the gov’t argued before him that it was not a tax. He chose to make his own findings not based on the law.
Your representation of what happened there is misleading — maybe unintentionally. The government may have claimed that it wasn’t a tax in its oral arguments, but by that time they had already submitted hundreds of pages of written briefs that argued many other — often contradictory — points. It’s a tax, it’s not a tax, it might be a tax, it doesnt matter if it’s a tax, etc. You can’t look at the oral arguments as if they are the sum total of all the evidence considered by the court.