Actually (or perhaps, in addendum), there's cases even in academia where you're not allowed to see or work on sensitive materials if you aren't a US citizen. I was part of a research lab, and they wanted to hire a PhD student as a research assistant. However, she was from Spain (not even a US enemy!), and there were a ton of hoops they had to jump through to assure NASA, the FAA, and the military that she would be compartmentalized away from any of the projects and contracts the lab took on from those guys (there were more than a few).
In reality, this has been going on years as a matter of course. And I say all the following knowing the wider context that Western nations and corporations also steal off each other and everyone else. (A friend of mine in the past claimed one his uncles worked in IT for a multinational and was occasionally tasked with to trying to hack competitors.)
Firstly, a lot of the reason that foreign scientists come to Western countries (often funded by their governments) is to learn our stuff and, often, take that expertise back home. I don't actually object to this, because my attitude to education is that it transcends borders. Governments with security concerns, however, have to accept that they are de facto training their geopolitical opponents - although there is of course a benefit that they often get to keep a lot of the other country's talent, because some those people will decide not to go back.
Secondly, places like China are obvously trying to get people into sensitive research projects, and obviously with the intent they'll be taking specialised knowledge. Not necessarily illegally of course - no-one can wipe out what people learn. But there are lots of cases where researchers appear to have accessed and downloaded an awful lot of stuff before heading home, including data that they almost certainly did not generate. That isn't necessarily on state or company orders - an ambitious individual has enough motive to steal data for personal gain as they can sell it or whatever. But I would not be surprised if there were literally hundreds of Chinese researchers in the USA currently with some degree of intent and/or state encouragement to steal research data for their home country, and the more sensitive the better.