Right, they passed a law, AB5, to better do that job.
"To dodge the shareholders' taxes is not one of the transactions contemplated as corporate "reorganizations."
And from the SC ruling:
"The whole undertaking, though conducted according to the terms of [the statute], was in fact an elaborate and devious form of conveyance masquerading as a corporate reorganization, and nothing else. ... [T]he transaction upon its face lies outside the plain intent of the statute. To hold otherwise would be to exalt artifice above reality and to deprive the statutory provision in question of all serious purpose."
If there's no business purpose beyond tax avoidance, the government can indeed hold you to the higher tax rate. I don't think that's what happened here, i think there are legitimate non-tax reasons for Uber/Lyft's structure, but it's not a completely unreasonable take to disagree with that.
And even if not, the government is free to change the law to fix things, which it did.
https://en.wikipedia.org/wiki/Gregory_v._Helvering
Government doesn't exist to collect taxes. They are there to provide governance. Taxes are a necessary evil that should be kept to a minimum to provide the service of governance.
If someone can come up with a legal operational structure that gets around taxes then that the government didn't do its job.
It's only easy to get around taxes when the taxes aren't closely tied to the service the government is providing. i.e. when you taxing one individual or business for a service provided to other individuals or businesses.