I think weapons manufacturing is a better example than software, because it’s much clearer. Weapons are necessary to defend free society, and when they are misused, we hold the misusers to justice.
Or at least we used to. Because today America is actively bombing civilians in 7 different countries, and no one is ever going to be held accountable for the outright human rights violation. I mean, it’s a war crime to kill civilians. I don’t think you can blame the weapons manufacturers for this though, and I don’t think we should have to. Because it’s our common ethics that should prevent it.
I guess, though, that in a world without accountability, your individual morals is all that’s left, but it’s our ethics that need to change if we actually want change. Because if you personally refuse to write the software, someone else will. Like I said, I think you should absolutely refuse to write the software because you won’t be able to live with yourself, just don’t expect the violators to stop unless we stop them.