I'm sure there have been evil theists and atheists. But most people aren't philosophically or profoundly committed either to their religion or to an atheistic worldview such as humanism. We use our ideologies as passes to get through the door of a social club, and we rationalize what we would have done anyway by appealing to anything that supports our illusion of being the star of the show and the hero of our narrative.
Most people don't live out the full implications of their abstract ideas or their so-called philosophical or religious beliefs. We're not all true believers. So the good or evil deeds of theists or atheists are often incidental to what they supposedly believe about ultimate matters. This is a deflationary answer to this concern about whether atheists can be moral.