I think it’s more there is a precedence of the government blocking software they think is a threat - https://cmmcinfo.org/list-of-hardware-software-and-services-banned-by-us-government/
We give the government a lot of leeway when it comes to “national security”
Also, we’re not the first country to ban it - https://www.pbs.org/newshour/world/heres-what-happened-when-india-banned-tiktok
Wasn’t claiming it was a good or bad call, just that the Supreme Court is about legality and there is history of the US banning software and a global history of banning this specific app.