CS Lewis writes in Mere Christianity:
Christians, then, believe that an evil power has made himself for the present the Prince of the World. And, of course, that raises problems. Is this state of affairs in accordance with God’s will or not? If it is, He is a strange God you will say: and if it is not, how can anything happen that is 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 schoolroom every night. You’ve got 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. This is against her will. She would prefer the children to be tidy. But on the other hand, it is her will that has left the children free to be untidy. The same thing arises in any regiment, 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 is 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. The happiness which God designs for His higher creatures is the happiness of being freely, voluntarily united to Him and to each other in an ecstasy of love and delight compared with which the most rapturous love between a man and a woman on this earth is mere milk and water. And for that they must be free.