It's arguable that Stalin was not so much an atheist, as the leader of a new religion (Soviet Communism), who saw other religions as a threat, and (like religious leaders throughout history) took bloody steps to attempt to eliminate the competition.
It's inarguable that Stalin learned how to run an oppressive quasi-religious regime directly from the Christians
at the seminary he attended for six years.
Christianity held a central and formative position in Stalin's childhood. He was far from being a mere atheist; He was an atheist who saw firsthand how Christianity corrupts a society, and who decided that he could do that himself, if only he could get people to switch allegiance to his new cult, and away from the established church.
Certainly it is disingenuous at best to hold Stalin up as an example of an atheist; Most atheists don't first train to become priests. Amongst atheists, Stalin is a clear outlier, and anyone hinting that he is somehow exemplary or typical of atheists is clearly either badly misinformed, or deliberately attempting to mislead.
People who are exposed to corruption tend to go one of two ways. Either they decide to spend their lives fighting against it wherever it is found, having recognised it as evil and wrong; Or they decide that if other people are getting riches and power, then they will have a piece of that action too, and become evil and wrong for fun and profit.
Stalin (and Donald Trump) fall into the latter camp, as do most mobsters and crime bosses. Religion has little to do with it, other than as a role model for how to fleece gullible marks (and in Stalin's case, gullible Marxists).