However the same argument could be applied to labor abuses in the textile/garment and shoe manufacturing industry. Most people who follow news are probably aware that about 20 years ago Nike, Adidas and other brands went through a period of terrible public relations disasters, after the working conditions in some of their shoe factories in developing nations were exposed by journalists.
The argument that could have been made at that time would also have been "well but if we don't employ these people, somebody else will just do the same thing with equally terrible labor/human rights violations somewhere else in the world, with even cheaper factories".
The situation today is not great, but it is significantly improved from how it was twenty years ago. There are third party neutral inspection/oversight agencies. Companies in the garment industry are forced to make public commitments to labor rights and reasonable working conditions, and to allow external auditing. They can't just hand wave away the problem and say "but if we don't do it , someone else will.."
A shoe is a physical artifact. It must be made somewhere out of something. Software is much more flexible. If I tell you to build an 'ethical' piece of software with an extensible API, it will only take a tiny amount of work to make it do something unethical.
And much like the shoe companies abusing labour's, that had nothing to do with the engineers that made a a product line, but the management that is driven to ever lower costs.
But that's a thoroughly discredited argument.
I don't want other people making decisions on morality for me. There are people who don't believe that software developers should develop software for the U.S. government because they don't like the way immigration law is being enforced. I'll make my own decisions about what is and isn't "moral", thanks.
There is no point wasting energy and time around such people if they don't share the same values.
It's not complicated (requires some networking) to find in any org, the characters who will "do whatever it takes".
Then getting them kicked out, opposing them, sidelining them, subverting them, avoiding them are all choices every Engineer has.
I've quit jobs in the past because of ethical concerns about the way in which those above me have been acting. In one case this involved bribery of senior government officials to push through a project that put at risk the privacy of hundreds of thousands of people.
If you go along with shit like that, you're an accomplice and share partial responsibility. As professionals we have a responsibility to stand up for what is right. It's not good enough to fall back to the lazy excuse of "just doing my job".