C.S. Lewis has a great passage on the topic that I need to share, in Mere Christianity:
How can anything happen contrary to the will of a being with absolute power?
But anyone who has been in authority knows how a thing can be in accordance with your will in one way and not in another. It may be quite sensible for a mother to say to the children, 'I'm not going to go and make you tidy the school-room every night. You've got to learn to keep it tidy on your own.' Then she goes up one night and finds the Teddy bear and the ink and the French Grammar all lying in the grate. That is against her will. She would prefer the children to be tidy. But on the other hand, it is her will which has left the children free to be untidy. The same thing arises in any regiment, or trade union, or school. You make a thing voluntary and then half the people do not do it. That is not what you willed, but your will has made it possible.
It is probably the same in the universe. God created things which had free will. That means creatures which can go either wrong or right. Some people think they can imagine a creature which was free but had no possibility of going wrong; I cannot. If a thing is free to be good it is also free to be bad. And free will is what has made evil possible. Why, then, did God give them free will? Because free will, though it makes evil possible, is also the only thing that makes possible any love or goodness or joy worth having. A world of automata--of creatures that worked like machines--would hardly be worth creating.