The reality is that in most of those fields, few Americans get an MS/PhD. Go to a typical engineering department and you'll often see the majority of advanced degree students are foreigners.
So it's a question of: Do we want to continue to train foreigners, only to not have them contribute to the US economy?
If you move out to the pure sciences, you pretty much need a PhD to get a good career. Once again, a big chunk, if not the majority, are foreigners.
Look around at the highly skilled folks you see who are not of US origin, and you'll find most of them are in the US due to the H1-B program (only a tiny percentage come via other programs like the O visa).
Yes, H1-B is often abused, but this is the reason it exists. It's a lot harder to get an H1B visa and then permanent residency if your degree is in the humanities, for example.