I mean, the "Civilopedia" entries for both is very lib, so that's probably part of it. The numbers they cite in Civ IV are ~20 million deaths under Mao as well as claiming "up to 10 million dead" in an "engineered famine" under Stalin. In an interview, the original creators said they primarily did all of their research in the children's section of the library, so that's probably at least part of the reason for The Black Book of Communism-esque figures. Thankfully, despite eating enough of an anti-communist buffet for an entire kindergarten, they managed to have just enough sense not to put Hitler in any of the games to my knowledge. Even in the baked in WW2 mod for Civ IV, they replaced him in with Franz von Papen(still a fascist piece of shit ofc, but way less name recognition).
edit: this is just the tip of the iceberg really. reading the Civilopedia after getting back into Civ IV has given me psychic harm. The Stalin section is thoroughly packed to the brim with all of the dumb tropes we've gotten used to debunking. I'd make a separate post about it if I could find the text files to quote more easily.