Only Christianity can satisfactorily answer this question.
This is perhaps the most common question Christian celebrities are asked to answer on shows such as Larry King Live. At first blush, it may seem as though there are as many responses as there are religions. In reality, however, there are only three basic answers, namely pantheism, philosophical naturalism, and theism. Pantheism denies the existence of good and evil because in this view god is all and all is god. Philosophical naturalism (the worldview undergirding evolutionism) supposes that everything is a function of random processes, thus there is no such thing as good and evil. Theism alone has a relevant response—and only Christian theism can answer the question satisfactorily.
First, Christian theism acknowledges that God created the potential for evil because God created humans with freedom of choice. We choose to love or hate, to do good or evil. The record of history bears eloquent testimony to the fact that humans of their own free will have actualized the reality of evil through such choices.
Furthermore, without choice, love is meaningless. God is neither a cosmic rapist who forces his love on people, nor a cosmic puppeteer who forces people to love him. Instead, God, the personification of love, grants us the freedom of choice. Without such freedom, we would be little more than pre-programmed robots.
Finally, the fact that God created the potential for evil by granting us freedom of choice ultimately will lead to the best of all possible worlds—a world in which “there will be no more death or mourning or crying or pain” (Revelation 21:4). Those who choose Christ will be redeemed from evil by his goodness and will forever be able not to sin.
“We know that in all things God works for the good of those who love him, who have been called according to his purpose.” Romans 8:28
Adapted from Resurrection