If you start from the assumption that everyone in the world is born equal and all deserve equal opportunities then the correct solution is to drop your nation's borders entirely. No borders at all, anyone can come. Germany basically tried that and lasted less than a year before the native population started to revolt. It's now stuck in a kind of ethical limboland where theoretically Germany still welcomes any "refugees" but is spared from actually doing so by other countries. I put refugees in quotes because there's no way to reliably distinguish refugees from people who just want a better life by the time they make it to Germany: they arrive without papers or proofs of any kind.
The reason the native population of Germans were unhappy about this policy is fairly simple: there's a perception that some countries are objectively poorer and worse than others because the people living there collectively made bad choices and built bad cultures. Thus importing them risks importing the problems of their homeland and killing the goose that lays the golden eggs.
For instance, India and South Korea both started out the 20th century being extremely poor and dominated by foreign invaders. They achieved full independence around the same time. By the end of the 20th century South Korea was an extremely sophisticated first world nation (this is the "miracle on the han river") but India was still very poor. Would letting all of India into western nations make everyone as rich as Americans? Or would it just flood native culture and decision making with caste politics and other rather non-American value systems?
Did it ever occur to you that the government of the US works for the United States citizens who pay their salaries?
If you would like to take $10k from your own salary and send it to someone on the other side of the globe, feel free, but I'm not interested in becoming a personal charity to the third world based on your personal ethics.
I upvoted your comment but I don't agree with the last half of it. I feel that the Indian programmer should be paid as much as any local programmer for the same amount of work at a comparable quality. If she's doing more of it, she should be paid more. [1]
The idea is that, as you say, moving to a richer country with a higher standard of living is a net gain, but the people who already live there benefit from this higher standard of living plus they get the higher wages on top. So the worker from the poorer place is still being taken advantage of.
Ideally, you'd hire workers on their skills alone and not be able to pay lower wages, but that's very hard to enforce.
[1] I've worked at places where contractors, the vast majority of them from India, were doing 2/3s of the work, yet they were paid less than everyone else. They were paid more than myself, even though I was a foreigner also. It upset me and it's one reason why the company in question never had my loyalty, and I was not happy working for it.
I feel that perhaps there is some degree of nuance here you've overlooked.
To take a specific example, maids in India make about $3 a day. If they had the opportunity to move to the US and do similar work at say minimum wage that is at least a 10-fold increase in their earnings. While the cost of living in the US is much higher than in India, its mostly because the quality of life here is much better. Back home she probably lives in a tiny shack in a slum with no running water. If she lived in the US college-dormitory-style, it would be a massive upgrade of her living conditions and still allow her to save money to say give her children a better education.
So what we're weighing here is $1000 reduction in the wages of some of the most vulnerable Americans against a life-altering opportunity to the most vulnerable global poor. I don't really see how Borjas (or anyone else) can pick the side of the Americans in this ethical dilemma.
Take another example. Say a college educated Indian female decides that she is sick of the sexism in India and wants a better life for herself. Using the large amount of resources online she teaches herself programming and becomes as good as people who graduate from coding bootcamps in the US (so not a stellar programmer but a net positive with proper guidance). Her primary competitive advantage is that she's willing to work harder and for lower wages than the Americans graduating from coding bootcamps. Requiring that she be paid the same (or more as many commenters have suggested) prices her out of the market.
So the choice we face is whether we allow her to work as a developer for say $40k a year which she would vastly prefer to being stuck in the shitty circumstances of her birth at the expense of perhaps reducing wages for American programmers from say $70k to $60k a year. Again I don't really see how this is a difficult ethical decision.