We have inate abilities to model reality in a way that helps us, not just in a cognitive dissonance way, but in strategic ways as well.
It's the classic "It is difficult to get a man to understand something, when his salary depends on his not understanding it.". It's wildly viewed as a skill, and in a lot of cultures marked as a sign of adulthood to be able to deceive yourself to overcome your primary reaction.
People whose morals are strong enough to suffer the harm and deal with the uncertainty of trying to find morally-responsible work aren't that common. And as soon as you have family responsibilities, the pressures increase.
The underlying problem is that compliant behaviours and attitudes are rewarded, sometimes generously, while dissident attitudes and behaviours are punished - often in ways that imply the dissident brought misfortune on themselves.
There's absolutely no mainstream reinforcement of the suggestion that many aspects of the culture this happens in are toxic and have a skewed moral foundation, and plenty of reinforcement of its opposite - that the culture is healthy, generous, open, and perhaps even the best of all possible cultures.
Yup - we might say that as a topic, it's been discussed throughout the ages. For example there are the findings of this guy Paul the Apostle (as summarized by an unknown transcriptionist sometime in the 1st or 2nd century):
For the love of money is a root of all kinds of evil. Some people, eager for money, have wandered from the faith and pierced themselves with many griefs.
-- 1 Timothy 6:10