China has some of the most draconian restrictions on foreign ownership anywhere yet still gets access to foreign markets. Major US corporations are often forced to set up Chinese-majority-owned subsidiaries to operate in China and must cede huge amounts of control to the Chinese government. Time after time, this results in locals ripping off the technology of the foreign company and then the foreign company being replaced by a local company. Look at the long history of US tech startups failing in China.
The point is that whether you think this specific action is right or wrong, it's totally normal tit-for-tat geopolitics. Countries impose tons of restrictions on foreign-owned corporations. You can't even do something as simple as set up an S Corp in the US if you are foreign.