Absolutely, and as a US citizen and resident, your country does a huge amount to benefit and protect you.
That's quite different from saying that the whole country should participate in parochial isolationism because some individuals cannot do what they want.
There's little evidence that, in the medium to long term, that approach does benefit and protect its citizens. History has tended to show the opposite.
That's maybe a bit too theoretical of a question, but let's say a person's bounds are his body. In order to protect bodies, we have constructed this idea of "countries" and "borders".
If a foreign body crosses a border and takes from another country and harms its locals, whether with a gun or with a piece of paper, isn't that bad?
Not sure what countries have to do with it. If someone takes something, that is rightfully yours, by force or other means then that's morally (and probably legally) wrong. It doesn't matter if they crossed borders or not.
But it's not clear that that's happening. In your OP, no-one has taken anything from you. They just haven't given you something that you feel you deserved but they, presumably, didn't.
You seem to be making the assertion that you've been unfairly treated, and that may be the case, I have no idea. But if you think that it's primarily down to foreign labour then the evidence is against you. There are a lot of US citizens employed in software development in the US. Much more than there are foreign nationals.