Banning TikTok is not impinging on free speech. People are still free to say whatever they want on so many (unrestricted) platforms. If someone makes a video of a TikTok video and shares it on Youtube/Whatsapp, that's legal. The actual content is legal, so it's not a free speech/censorship issue.
This is the equivalent of "We've put sanctions on China. You can write whatever you want, as long as you don't do it using Chinese pens and Chinese paper"
It's not at all unusual for countries (including the US) to restrict commerce with a country if they believe the other country isn't engaging in fair commerce.