If my workplace tomorrow decided to implement things I ethically disagree with, I cannot in good faith say that I would quit. It's easy to say stuff like that, but when you have a mortgage, have family that depend on you, a home you've put tons of work into, hobbies you love... I mean you can call me a sellout if you want, and I couldn't really disagree, but why is that burden on me? To relieve the politicians of the awful work involved in doing their job?
My job is to write code. Their job is to write law. Why must I quit mine and jeopardize my livelihood so they can eschew theirs?
As for quitting... if you were a factory worker in a one-company town, you'd be in a worse spot. But I hear that software engineers are in demand these days. And if you're in somewhere like the Bay Area, there are many options available to you.
For that matter, there may be many options available to you even within your own company. You may not be able in good conscience to work on that project, but can you transfer teams? And, if you're feeling that it might be useful, tell them why.
On the other hand, that leaves such a team with nobody left working on it that has a functioning conscience. That's not ideal, either. But that comes down to your judgment about whether you can actually change the course of the team. If you can't, what's the point in staying?
I have two grandfathers, one found a way to evade the Nazis and one was a Nazi. The former always said they were uncultured and barbaric, without humanist values. The latter said all he did was following orders and the law, and they built streets after all.
In my eyes the ahistorical period is over, and in hindsight it never matters how convincing your excuse is, when your grandchildren ask you what you did when X happend. If you can change culture for the better, do it.
The Banality of Systemic Evil: https://opinionator.blogs.nytimes.com/2013/09/15/the-banalit...
It's sad that thoughts such as yours and mine get downvoted. Even an Upton Sinclair quote that no one can honestly disagree with gets downvoted, all because we're touching on people's comfy lives and self-esteem.
And that's not to say I wouldn't be finding a new job, but again, I wouldn't have to find a job, nor would my boss be pressuring me to do this sort of unethical stuff, if the unethical stuff was simply made illegal. Settles the matter entirely. Will there be bad actors skirting those regulations? Of course, there always are, but laws don't stop 100% of bad activity and that's never stopped us from trying.
Because you are always responsible for your own actions. You may face difficult choices and unwanted consequences, but you can't abdicate your responsibility for your actions.
Note, I'm not suggesting that in the particular scenario you described that there is an obvious right or wrong action, just that you have to accept the consequences of the whatever you choose to do.