Developers are likely to want to reject work like this, but are coerced into it by their employers (who threaten workers with loss of work, various punishments, loss of healthcare, reputation damage in industry if workers do not comply with tasks given to them). This was an ownership/exec level decision. Yes, we should be beware of "lone wolf" employers (hierarchies which allow the decisions of some isolated few to coerce many under them).
Managers could fish around for a mercenary-mentality programmer to do this without coercion. They have information on people's backgrounds, know about other morally dodgy things they may have coded before, and know the general temperament of their programmers. Find the guy who used to work for real scammy adtech companies before yours, who likes to espouse extreme libertarian talking points in the lunchroom, who maybe has a gambling problem or is otherwise looking to get a lot more money and seems like he would probably would steal from you if he found a way. Hint that doing the job will be good for his career or come with bonuses. Now you have a compatriot in crime instead of a coerced victim; this way he's more likely to keep his mouth.