A combination of compartmentalization and churn can keep the charade up for quite a while, and if executed well you can have a pretty big operation with only one or two people being in on it.
I figured something was off but there's a whole gradial spectrum of Schroedinger's Accomplices where most people can seem to be conners or conned.
For this reason, I found the documentaries on NXIVM (Seduced, The Vow) quite interesting - the way the protagonists are framed and how everyone seems to have plausible deniability even with all the video material.
I disagree with your moral conclusion - we all have responsibility as individuals with regards to what our work contributes to. This goes for anything from military personnel to software engineers. That you don't have legal risk doesn't mean you don't have ethical responsibility.
Does that really work in the real world? When you don't have workplace rights and concepts like "at will employment", can you really expect the individual to have any sympathy towards the company or society?
If you and your job is as expendable as a tissue and you struggle your whole life to get one, be in one and earn the almighty dollar, where the lack of the dollar means your kids go hungry and cold, would you place higher priority on morals for "the greater good"?
Those who are made to do un-ethical things in companies are usually picked because they have no other way than to be in the job, or are greedy enough to put their morals behind them.
Good luck trying to force morality on either of them.
I think you conflate these two things somewhat:
Of course there are always extreme situations when people are left with tough decisions and have to choose between "doing the right thing" and sustaining themselves and their family.
Separately, there are egotistic people who will disregard the consequences of their actions on others. For those who only care about themselves, it is hard to change things without changing incentive structures.
Finally, some are just ignorant because they don't know or didn't think it through deeply.
Neither of these are justifications to look the other way for those who can find employment either way and are choosing between an $80k job and a $200k job.
To some extent, companies like Theranos succumb to the greed and vanity of its founders.
Sure, the idea is revolutionary, but when the time comes where you realize you have a lemon, it ought to be shut down, or pivoted.
The following is probably just an already completely debunked conspiracy theory with zero basis in fact but what you describe is precisely how special compartmentalized intelligence works. Maybe many of the corporate and government organizations in security and intelligence operate in this siloed way, possibly at the risk of a lack of oversight and accountability which helps any abuses go unaddressed. Official secrecy oaths and classification perhaps compounds this vulnerability to misuse.
And except for the public heads very occasionally rolling, it's likely nobody takes responsibility (in a justice sense) when abuses occur. How do you get people to carry our these things? Simple finance, and isolation could be one way as mentioned. Coercive control via blackmail, planting evidence, fake accusations or intimidation could be other effective methods, especially when you need to secure the cooperation of key people outside the organization, and especially when your daily work involves intelligence collection and deception.
If it occurs at a deep level under the security and compartmentalization shields, then it's unlikely checks and balances could correct it if this sort of corruption was occurring.
When you read about iphone development Apple isn't that different. Only Jobs and a few other people knew the whole picture. The rest worked on their little area while not seeing the whole product.
Which is what Madoff did, I believe.
While employees may have doubt, they can justify their actions by thinking they are doing "their" part correctly. Which, I can relate to.
If I am not doing pseudoscience and am working on tech / systems that are good in my domain, why would I bother about the whole picture? Morally, yes. But if you have loans to pay and a family to take care of, and are getting your salary on time, everything else is the management's fault.
I can get a job in a similar field somewhere else.
And, IMHO, it is the management's fault out and out. The reason they get to take the big cheques is because they bear the responsibility.
It's not the responsibility of the average lower level worker to worry about it.