Teehan, John. "Cognitive Science, Evil, and God", in De Cruz, H and Nichols, R. (2016). Advances in Religion, Cognitive Science, and Experimental Philosophy. London: Bloomsbury Academic, 39-60.
Here's a summary of the paper from the editors' introduction to the book:
John Teehan looks in more detail at the problem of evil, a classic challenge to theism in philosophy of religion. This problem has received a lot of attention in mainstream philosophy of religion, and according to Teehan, cognitive science can further strengthen it. He shows this by considering the features of our evolved morality. Traditionally, the fact that humans have some unlearned (probably innate) sense of what is right and wrong has been regarded as evidence for theism; see, for example, formulations of the moral argument by Swinburne (2004). A crucial and often-overlooked feature of evolved morality is that it is an in-group adaptation. As a result, humans are more morally sensitive to those they consider in-group members, and conversely, they can be indifferent or cruel to those they consider part of the out-group. Teehan surveys empirical evidence for this, for instance, that people are less empathetic toward people who experience pain if they believe them to be out-group members (e.g., of different ethnic groups). This suggests that some moral evil, such as prejudice, between-group violence, and dehumanization, results from a properly working system of evolved moral cognition. This presents a challenge to theism. Teehan proceeds to consider some theodicies and argues that none is successful.
Absolutely required reading.