First of all, the Bible makes it clear that God has no pleasure
in seeing sinners die which lead them to eternal punishment
(Ezekiel 33:11). He created man for His glory and for His
pleasure (Revelations 4:11). Now here's a question... If you're
God, will you derive pleasure from the "love" your created gives
you if in the first place, you have programmed them like robots
to give you love (they have no choice but to love you)? I believe
that you'll agree that "love" that's not freely given is not true
love. God had to give man a free will so that He can experience
true love from His created so that pleasure is achieved. He
wanted man to love Him willingly. Free will allows man to love
God willingly. That's why God gave us free will. Not doing so
goes against reason. God is a logical Person that's why He saw it
right to give man the freedom to choose for himself and He hoped
that we'd use it to give Him pleasure