Have corporations done bad things? Of course, and so they are regulated, and there are processes for dealing with bad corporate behavior.
Space is maybe the clearest example of the problem with governments doing anything outside of creating a playground for innovation. 1969 was probably the greatest single government led achievement. We put a man on the moon, having only first put a man into orbit in 1962 and any object into orbit in 1958. That was when space had the government's full attention both as a possible means of weaponization and as a soft power victory of communist powers [ironically] aiming to show the resolve and capability of capitalist nations.
But that same story also shows the downsides of government dependence. Today, nearing the 50th anniversary of putting a man on the moon - we're severely struggling to try to send a man around the moon. And in fact no human would ever leave low Earth orbit after 1972. We not only stopped progressing technologically, we actually and literally technologically regressed. On top of this regression, government never has much of any motivation to cut costs or improve efficiency since they're short term public 'servants' who are just spending other peoples' money. Because of this costs became insane. After all was said and done the Space Shuttle program ended up costing more than half a billion dollars per launch.
At the risk of being tautological, corporations let people pursue what people want to pursue. Governments, by contrast, pursue what governments want to pursue. If you don't like what the government's pursuing you can try to influence votes, lobby, or 'raise social awareness' but in reality it's generally going to be about as effective as pissing into the wind. By contrast, anybody can start a company and start making whatever they want to. And indeed maybe SpaceX would be the proper epilogue here.
Enter corporations. Elon Musk wanted to send a greenhouse to Mars. The costs were unacceptable. It made no sense to him why a rocket that cost on the order of tens of millions of dollars in materials would cost hundreds of millions of dollars to contract. And indeed it didn't make any sense. So he started a company and changed it. Now costs are down by nearly an order of a magnitude, SpaceX is one of the world's largest supplier of launches, and it's looking increasingly likely that the first person to leave our orbit in nearly half a century won't be doing so on a government rocket, but on a privately built, privately funded, and privately launched rocket.
Of course SpaceX would never have been able to get to where they are without governmental contracts and assistance, so I'm not proposing anything like anarcho-capitalism, but rather that government should is the one that provides the sandbox - the people are the ones that build as they choose.
I'm not able to turn off caring about what I work on, although I have picked up some tricks over time that help me turn that caring on. However, there's if I'm working on something that is ultimately lame, eventually I'll run out of stuff to care about. That's when the soul crushing starts to happen.
A very important factor whether the work is soul-crushing or not is whether the work is intellectually stimulating or not.
Solving problems, working on tight deadlines, and getting recognition, status, and money are all things that make a person feel like what they're doing is right. It gives an endorphin high, it's a sign that other people are recognizing their work. I hesitate to use the word "addictive" in this context, but it can certainly be compulsive. It's easy to lose sight of whether what you're doing is what you ought to be doing when the act of doing it is so compelling, financially rewarding, and celebrated by others.
This isn't a justification; it is a warning to anyone coming into this field, a warning that I wish I'd thought more about coming into it. This is something we need to be vigilant about as engineers, because it's easy to look the other way on questionable activities by your business when everything else in your life is becoming enriched by it and they're telling you that the ethical issues are for "their side of the business" to worry about. It is not. Do not believe them. Understand where your paycheck is coming from, and make sure that you continue to evaluate it as your company changes and ask yourself if you're okay with it.
In my career, I have:
* Been lied to about the true purpose of a product we were building, and only realized the lie because another engineer was brave enough to call them out and force them to tell the truth. I was fully prepared to be the coward that didn't follow up on it and remain willfully ignorant, and his ethical bravery was the only thing that snapped me out of it.
* Seen a company's financial plan gradually change from an ethical one to an unethical one, and have seen good people struggle and contort themselves to justify it: including myself, for a time.
* Worked in fields where the profits gained by maintaining the status quo has created a desire for minimium compliance instead of continual improvements.
The mandatory ethics class I took for my CS degree never prepared me for what to do, how to be vigilant, or how to take action when it is the company itself that is the unethical one. I feel like we need to have open and honest discussions with people coming into this field about this very real possibility, and about the need to evaluate not just the compensation and interesting problems being presented by a given business, but also the ways that they earn money and whether it is something you find acceptable. And what to do if that situation takes a turn for the worse.
The ACM has some high-level recommendations in their ethics statements, and I think they're a good start. They should be required reading for all software engineers.
I have been a coward. I have been an example of the banality of evil. And I don't think I'm alone in this field: not by a long shot. We've got to pay attention to the ethics of what we create, and we need to be much more brave than we have been.
It's so easy for me to slip into those addictions and not pay attention to the bigger picture. And I feel like I'm not the only one suffering from this problem. In fact, I can see it empirically in the people who have worked at the aforementioned jobs with me.
There needs to be a balance. A person doesn't need to be outright altruistic, but focusing exclusively on local optimization allows for a sort of hedonistic behavior set that can justify - and has historically justified - participation as a cog in larger and harmful systems.
Why? Even doctors have been doing nasty things for money (e.g. bribing by big pharma). And they have an official ethical code!
It's exactly like how hardcore libertarians respond to anything good the government does ever by saying the free market would've done it even better: their dogma doesn't permit them to say otherwise, and so they can safely assume they're always right.