Why is there evil in the world?
It is one of those questions where no matter the answer, you could always ask again, 'but why'? One could just as easily ask, why does God exist? Or, why is God righteous and holy instead of evil?
I can attempt an answer as a Christian based upon the Scripture and some philosophy.
First of all, God doesn't explain why He exists nor why He is righteous and Holy. He just states the fact that He is. "In the beginning God". (Gen. 1:1) The question of 'why' as to His existence cannot be answered on this side. "The secret things belong unto the LORD our God" (Deut. 29:29)
But God does exist. He is holy, righteous, and good. Because He exists, and is holy, righteous, and good, anything outside of His existence is evil. Nothing measures up to God. Just because nothing exists doesn't matter. God exists. And anything outside of His existence is evil. Righteousness and holiness is personified in the Person of God.
Any and all laws recognized in creation reflect the holy righteous nature of God. God is life. Death is contrary to God. Yet God says, "...Except a corn of wheat fall into the ground and die, it abideth alone: but if it die, it bringeth forth much fruit." (John 12:24) This is true only because God is. Only because God says so. Out of death comes life.
God wants sons. Family. In the plan of God to obtain that, death is necessary. Because out of death comes life. Adam and Eve in the Garden were perfect, but were not of God's Person. To a degree, much like the story of Pinocchio who in the end becomes a real person instead of a wooden puppet.
Death is necessary but death is contrary to God Who is life. To just kill Adam would run contrary to God's nature. Because God exists, evil exists as it is anything outside of God. For man to die and obtain eternal life as true sons of God evil must enter personified also. Which is why God created Lucifer. (Ezekiel 28:15) Which is why God put Satan in the Garden.
God places the Tree of the knowledge of good and evil in the garden with the prohibition not to eat of it or you will die. And when man does eat of it, then death passes upon him. He will die justly for his sin. And God will justly raise up His sons to live truly as His sons, forever. (John 12: 24)
Just my opinion.
Lees