I know that I have posted this elsewhere; but it seems to fit here.
IMO, God created mankind because He wanted a creature able to receive and return His love.
The price God paid for a creature able to love Him was He got a creature able to reject His love.
Love must, by its nature, be volitional.
God was faced with a choice between preventing both sin and love or preventing neither sin nor love; because love cannot exist without the possibility of its rejection; which is the essence is what sin is .
To make love possible; God chose to temporarily permit sin to exist; since the alternative is a world without love.
I would like those who believe that God's election is independent of freewill to explain why God permits evil in the world.