all true.
we also let them flood our universities and take the knowledge back to their country which was willing to use it
its worth noting that this isnt exactly how academia works.
By the very nature of STEM research , you need to collaborate with people around the world. And your discoveries must be defended against rival insitutions and countries that seek to replicate that data. This public defence is how academia can avoid frauds like theranos that occur in the less open bussinesss arena. BUt this openness is also a way to bounce ideas off of colleagues to build new research.. But in order to achieve this academic rigour, all American university research is openly published and available in STEM journals. For example my Grad school alma mater had DOD darpa contracts and you could basically look up all our research by just buying a subscription to an academic journal or online agragator like JStor
Now i do understand the need for discretion in sensitive research, but that is why the defence and intelegence agencies have in house scientists and engineers. Just like there are public journals , there are also internal govt journals that are classified. The securty for these is much tighter requiring top secret clearance and direct DOD employement. This is stark contrast to the stuff foreign students have freely available at public research at universities.
And this is just the high tech stuff. As for the basic education, that is also freely available. For example, undergrad and masters coursewrk and sylibi form Stanford, MIT , and Harvard is also freely available. So are most of the lectures. So the foreign students wouldnt be gaining anything in particular by taking undergrad coursework in STEM fields.
In most cases those foreignstudents are just a cash cow. With no actual risk to the universities because of the need for openness in academic research. There is no super secret information that these students would ever get.