My answer to your question is ‘free will’. You see, God created the world perfect and wanted to live in peace and harmony with his creation but it didn’t take long before his creation rebelled against Him. Because God loves us so much, he has to allow us to have free will because perfect, real love demands free will, if there is no free will then it’s not real love. Unfortunately too many of God’s creation (humans) have rejected God & the saving sacrifice of Jesus and gone their own way causing much grief, pain and evil in the world. So it’s not God that created evil, he can’t because he is good, it’s humans, more specifically the Devil that controls humans to do such terrible things in this world. And yes God allows evil to persists in the world because he can’t interfere with our free will but he has devised an amazing plan for life after this world where there will be no more sadness, misery and pain. Evil will be destroyed forever more so in the end goodness will ultimately win.
God bless you.