Not intending to inflict Godwin's law, but the "Nazi soldier defense" is unacceptable. There is no just following orders, or if I do not do it, they will find somebody else. You simply do not do things which you think are wrong. Yes, that could mean that you might have to find a different job. As a software developer you are responsible for everything you create. You are also responsible for challenging designs/solutions handed to you.
There is a reason why the "true" engineering disciplines object to the term software engineer. It is because in general software developers do not respect the engineering ethics.
Within the software industry we have two major learned societies: IEEE and ACM. Both worked (and continue work on) a code of ethics for software engineering.
I cannot say I really have any personal ethics as I subscribe to the IEEE/ACM code of ethics, which covers pretty much everything really important.
I do have a bunch of mantra's I keep to (as much as possible):
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.