Why would a good God allow evil in the world? This problem, one that Judeo-Christian man had created for himself by his belief, has haunted Western thought for millennia. It is plainly a by-product of ethical monotheism—“a trilemma” created by the three indisputable qualities of an all-knowing, all-powerful and all-benevolent God...Not until the 18th century did Leibniz give a name to this troublesome problem—Theodicy, from the Greek theos (God) and dike (Justice)...This question has not equally troubled people everywhere. Religions in the East have provided plausible theological explanations for divine punishment and retribution in the concept of karma (the accumulation of debts from earlier lives) and the work of Kali and other destructive divinities.
Daniel J. Boorstin, U.S. Librarian of Congress Emeritus
So we have two view points
1) Atheists presume there is no justification for evil. This rules out, according to them, the possibility of a God being perfect (meaning all-wise, all-powerful and all-good).
2) Theists presume evil is justified. They argue that God has neither created evil at His own whim, nor is He powerless to stop it.
A defense of theodicy—the justness of God—requires a sound explanation of how evil is part of God's plan for everyone's ultimate good.
Vedic philosophy has three contributions to make here.
1) Evil is the consequence of one's desire in connection with material nature.
2) Material nature has two aspects: one that binds us (thus giving rise to evil), and one that releases us (thus ending evil).
3) The medium of our bondage is our own desire. Under the thrall of desire, we pursue material objects that we are convinced are good.
In short, theodicy, “the attempt to understand the relationship of the God to a cosmos that suffers,” remains an intractable problem as long as we do not admit that it is madness for the spirit soul to seek happiness in the material world.