Think about it for a minute. Which is more loving: a God who creates a world in which love is possible, or a God who creates a world in which love is impossible? It seems reasonable that a loving God (if He exists at all), would create a world where love is possible. A good God would create a world where love can be experienced and expressed by creatures designed “in His image”. But this kind of “love-possible” a world is, by necessity, a dangerous place. Love requires freedom.
True love requires that humans have the ability to freely choose; love cannot be forced if it is to be heartfelt and real. I cannot force my children, for example, to love me. Instead, I must demonstrate my love for them, provide them with the knowledge and moral wisdom necessary to make safe and loving choices, and then allow them the personal freedom to love one another and do the right thing. Eventually, as a parent, I have to let go, and this process of letting go is dangerous. In order for my kids to have the freedom to love, they also need the freedom to hate. Freedom of this nature is often costly. A world in which people have the freedom to love and perform great acts of kindness is also a world in which people have the freedom to hate and commit great acts of evil. You cannot have one without the other, and we understand this intuitively.
http://coldcasechristianity.com/2017/why-would-a-good-god-allow-moral-evil/