I don't think we can say "most" Tor traffic "is illegal" [1]. At the very least, we agree that some of it is legal. That means Cloudflare, a private company, is treating users differently based on its interests and its interpretation of the law.
> A government official (or anyone, actually) trying to check for compliance with the law isn't doing anything illegal
They probably aren't. Neither is Uber. They're just treating their users differently based on their interests and interpretation of the law.
Law enforcement has tough-as-nails methods at its disposal. It could subpoena, audit, intercept, sue, et cetera. The downside is those methods come with oversight and transparency requirements.