God or the Laws of Nature dictate that men are free to choose so we can be tested on how we will act according to our covenant. According to our foreordination (some of which can be found in each of our Patriarchal Blessings), each of us will be given agency, the power to act righteously, during some part of our mortal probation.
Consider the implication of sin. When a person sins, the spirit immediately vacates his person. Sin brings upon an individual darkness and isolation from God. Can anyone act righteously when under the influence of sin?