I agree, you should be able to install whatever the fuck you want.
Google and Apple shouldn't be helping China get you to do that, by hosting and advertising it in their app store though*. Oracle shouldn't be helping China spy on Americans by hosting their services.
This isn't a law against you installing things on your phone. You're still free to install whatever you want on your phone.
*And if there is a valid first amendment claim here, it would probably be Google and Apple claiming that they have the right to advertise and convey TikTok to their users, despite it being an espionage tool for a hostile foreign government. Oddly enough they didn't assert that claim or challenge the law.
The problem is that the rhetoric around this law from its promoters is that of an app ban, not a business sanction. And indeed, the app is being banned from Apple and Google's app stores despite it being free to download and use.
The government currently lacks the ability to yank a binary from computing devices en masse, but the technology to do so is already mostly in place. (See Apple’s notarization escapades in the EU, for example. And I think Microsoft is working in a similar direction: https://secret.club/2021/06/28/windows11-tpms.html) I have a sickening feeling that this is only step one, and that the government will eventually mandate the ability to control and curate all software running on desktop and mobile devices within the country for “security” reasons. National security goons are salivating at the prospect, to say nothing of US corporations that are getting clobbered by foreign competitors.
For most people the Venn diagram of things that are possible to install on your phone and things on the app store is a single circle.