Current status: my job, yes, it's specifically about preventing badness. The company, generally yes, although there are some definite areas of concern.
This is something I've thought about on a regular basis; usually before I take a job, and again if the project changes. I have a couple of thoughts about this:
1. Finding software jobs right now if you have experience is like shooting fish in a barrel. If you have any question in your head that requires serious examination to tease apart whether it crosses the line into immorality, save yourself the time and energy and exercise the option to go elsewhere.
2. There are some projects that absolutely fall into the "will not work on" bucket for me. Weapons, payday loans, etc, anything that causes or benefits from human suffering, etc.
2. If you have the energy, I think joining an organization which has unethical fundamentals and trying to redirect it is a worthy goal, as long as you don't lie to yourself about how effective you're being, which I suspect will generally be "not at all".
3. I try to keep my buckets for "ethical" and "not ethical" reasonably clean. At some level, you can argue that any organization not primarily focused on fixing the issues with our societies is part of the problem, which pretty much limits you to non-profits and (in some parts of the world) government/healthcare organizations. That's fine if you're inclined that way, but making money selling products/services to consenting adults should not be seen as evil; I find this kind of perfectionist/puritanical thinking muddies the waters substantially.
4. I focus a lot on the people that I'm working with. I think that most projects that don't obviously fall in the "evil" bucket can be run ethically or unethically. In my experience, it's not that hard to pick out people who are fundamentally grifters, and if I see them in places of power in the organization/company, I'm looking at the door.
5. I did a lot of research before taking my current job to see what the complaints are about the company. It's a bit annoying because a lot of the CSR ratings are behind paywalls, but the information is out there.