{Say, “The truth is from your Lord. Whoever wills may believe, and whoever wills may disbelieve...} [28] Surat al-Kahf: 29.
The Creator could have made us forced on obeying and worshiping Him; however, compulsion does not achieve the goal behind creating man.
The divine wisdom is manifested in creating Adam and distinguishing him with knowledge.
{And He taught Adam the names of everything; then He presented them to the angels, and said, “Tell Me the names of these, if what you say is true?”} [29] Surat al-Baqarah: 31.
He granted him the ability to choose.
{We said, “O Adam, dwell in Paradise, you and your wife; and eat pleasantly from wherever you wish, but do not approach this tree, or else you will both become the wrongdoers.”} [30] Surat al-Baqarah: 35.
Moreover, He opened the door of repentance for him because the will to choose must inevitably lead to mistakes and sins.
{Then Adam received some words from his Lord, and He accepted his repentance. He is the Accepter of repentance, the Most Merciful.} [31] Surat al-Baqarah: 37.
Allah Almighty wanted Adam to be a vicegerent on earth.
{And [remember] when your Lord said to the angels, “I am going to appoint a vicegerent on earth.” They said, “Will You appoint on it someone who will spread corruption therein and shed blood, while we glorify You with Your praises and proclaim Your holiness?” He said, “I know that which you do not know.”} [32] Surat al-Baqarah: 30.
So, the will and the ability to choose are, in themselves, a blessing if used and directed in a sound and correct manner. However, they turn into a curse if used to achieve corrupt objectives.
The will and ability to choose must be surrounded with risks, trials, struggle, and self-striving. They definitely represent a higher rank and honor for man than subservience that leads to fake happiness.
{Not equal are those believers who stay behind – except those forced by necessity – and those who fight in the way of Allah with their wealth and their lives. Allah has given a higher rank to those who fight with their wealth and their lives than those who stay behind. To each Allah has promised a fine reward, but Allah has favored those who fight over those who stay behind with a great reward.} [33] Surat an-Nisā’: 95.
What would be the benefit derived from reward and punishment if there has been no free will for which one deserves recompense?
Despite all this, it should be known that man's actual choices in this life are limited and Allah Almighty will hold us accountable only for what we have chosen freely. We have not chosen, for example, the circumstances and the environment we grew in, nor have we chosen our parents, besides the fact that we cannot control the way we look or the color of our skin.