The problem of evil–why does God make a world in which bad things happen to good people?–is a hard one. But the problem of supernatural evil–why does God make a world in which good people do bad things in the name of God?–is a much harder one. [From The Problem of Supernatural Evil]
For the second part, assume God to be whatever moral code or ethical framework you believe it.