> People can't just leave Wednesday and be in a new job with the same or better pay next Monday.
They don't have to leave, they can refuse to comply with unreasonable requests which are likely to cause harm by jeopardizing the security of user data.
Maybe your position is too precarious to risk getting fired, but if your job is asking you to do something unethical then you should be doing everything you can to get yourself out of that situation, either by supporting unionization or by being willing to take a manageable pay cut to find a new job as soon as possible.
If you're a software developer then you can almost certainly afford at least a moderate pay cut for upholding ethical conduct. The vast majority can even if we don't want to, but these situations are where we find out if our ethics are for sale or not.