I think it's not so much that religion is the cause of racism so much as that religion is so often used to justify racism, not to mention sexism, homophobia, etc. I doubt Roof is racist because he's religious. It's just that he's used religion to feel justified in his racism.
If there is a god, I want to believe that there is a god. If there is not a god, I want to believe that there is no god.