What leads you to believe Stalin was an atheist? There is significant evidence that he never really shook off the seminary training he had as a young man, and that his support of religious persecution especially prior to WWII was largely from fear that the church represented competition for the loyalty of the people.
You're also forgetting some religiously inspired slaughters, e.g. the Taiping Rebellion in China (led by the self-announced brother of Christ) killed twenty million. But it also isn't a competition in which the body-count determines who is worst. An atheist who kills to achieve power, or a supposed Christian who kills to achieve power--which one is defying the moral code he claims to believe in?