At first glance, text like this may have been included to prevent countries from attempting to claw source code from closed-source software and cloud vendors.
It would appear to be troublesome, at a minimum, for copyleft projects, too.
And why is that so bad? A nation should be allowed to enforce laws to know the source code of its software because otherwise backdoors could kick in at some point, and other nasty stuff.
Just like private citizens, a nation should also be allowed to enter into contracts where all the parties agree not to do things to each other that none of them want to have done to themselves.
You are simply describing the concept of a mutually symmetric contract. I think everybody here understands that concept.
Nations should also decide in a way that is representative of the desire of the population.
Perhaps the population thinks the following:
"Just like private citizens, a nation should also be allowed to enter into contracts where all the parties agree not to do things [commit cyber crime/negligence hidden behind the veil of closed source software] to each other that none of them want to have done to themselves."
Such a requirement has positives and negatives, which are dependent upon point of view.
From the position of a free-trade agreement, it would be a statement of trust. We trust you enough to be our partner that we won't attempt to claw open your citizens' code if, in return, you don't do so to our citizens' code.
Entering such an agreement might be unwise, should a counterparty turn out to be disreputable or irresponsible.
Certain countries (China) have used this as a way to gain access to technologically advanced source code. They then turn around and share that code to domestic industry so that they can develop competing products that blatantly rip off the foreign companies.
You are confusing open source with theft. I never said that China was open-sourcing the code, I said they are misappropriating it and giving it to specific Chinese companies. And, they certainly aren’t mandating that the Chinese companies return their improvements to the commons, or even to the company they stole from.
As the provision above states: "as a condition for the import, distribution, sale or use of such software, or of products containing such software, in its territory."
A country could state simply: If we can't audit your code, you can't import, distribute, sell, or use it in our country. See: United States vs. ZTE for a hardware example.
It would appear to be troublesome, at a minimum, for copyleft projects, too.