I disagree. I've been very intentional about the places I work and have managed to build a successful career while never implementing a dark pattern.
"I was just following orders" is not an excuse. Take responsibility for your actions.
Part of my success in this has been being more selective in the job search so that I'm not working at such a company to begin with.
I'll note that jobs which don't behave ethically with regards to dark patterns, also tend not to behave ethically with regards to their employees. If people care more about making money than doing what's right, that tends to be pretty pervasive in their behavior.
That said, I realize there's some privilege implicit in what I said.
But that likely isn't the reality of the situation. If you're employed in software in the West it is very unlikely that your children are on the verge of starvation. Much more likely is that you might have to accept a slightly lower standard of living to work at companies that behave ethically, and I'm not particularly sympathetic to that.
Hell even in your example, there is a difference between some programmer who tells themselves this and some person who raises a stink; suddenly doing unethical shit slows you down, costs political capital, and approaches being more trouble than its worth. Fewer shit things will get done because there will be less energy to pursue them.
I'm not even suggesting you go out and be some citizen activist - just be normal. You'd have feedback for other kinds of stupid idea.
What we really need is some kind of Hippocratic Oath for Software, that we all agree to and can collectively use to resist this shit. Not going to happen, but one can dream.
Why spitball about a "Hippocratic Oath" when the ACM code of ethics exists?
You could promote the one that does exists instead of dooming that nobody will write or follow such a standard.
People are literally committing suicide because of code software developers write. Not for ICE or despotic regimes, but for Facebook.
Now I'm not sure a ransom signup pattern reaches that level, but the idea that dark patterns can't reach that level isn't in evidence. While the impact of a piece of software you write on a given individual is usually small, a decision made in software has the power to reach many more people than a decision made by a doctor about a specific patient.
Software developers need to take responsibility for their actions and stop blaming their bosses or society for their actions. What we do, does matter.