God could forcibly prevent people from sinning, but that would not enable us to achieve the potential that He desires for us to achieve. His will is that we learn right from wrong and that we choose to do right without pressure from Him (Deuteronomy 30:19 Deuteronomy 30:19I call heaven and earth to record this day against you, that I have set before you life and death, blessing and cursing: therefore choose life, that both you and your seed may live:
American King James Version×; Amos 5:14 Amos 5:14Seek good, and not evil, that you may live: and so the LORD, the God of hosts, shall be with you, as you have spoken.
American King James Version×; Acts 3:19 Acts 3:19Repent you therefore, and be converted, that your sins may be blotted out, when the times of refreshing shall come from the presence of the Lord.
American King James Version×; Romans 12:2 Romans 12:2And be not conformed to this world: but be you transformed by the renewing of your mind, that you may prove what is that good, and acceptable, and perfect, will of God.
American King James Version×). We must have free will to make those choices; otherwise, we will not develop godly character (Romans 5:3-4 Romans 5:3-4  And not only so, but we glory in tribulations also: knowing that tribulation works patience;  And patience, experience; and experience, hope:
American King James Version×).
By analogy, people do not break the law when the police are watching. Does that prove that they are good citizens? No, for they are under pressure to comply with the law. We demonstrate good character by obeying the laws of the land when no authority is standing over us. It's similar spiritually. God makes His laws known to us, but leaves it up to us to act on that knowledge.
Working with us in this way requires infinite patience on God's part. Like a wise parent, He realizes that we need the freedom to make mistakes. By analogy, wise parents allow children in their teenage years to make and learn from mistakes, realizing that it is the only way they will learn and develop good character. Of course, parents still give their children guidance, comfort and help; but parents don't control every aspect of their children's lives. If parents are unwise and too controlling, their children never develop the maturity they need to manage their own lives.
Likewise, God does not control our every action. He allows us the freedom to obey—or to sin. God also allowed Satan to be active in this present world, playing upon the weaknesses of human nature and tempting people to make wrong choices (Ephesians 6:11-12 Ephesians 6:11-12  Put on the whole armor of God, that you may be able to stand against the wiles of the devil.
 For we wrestle not against flesh and blood, but against principalities, against powers, against the rulers of the darkness of this world, against spiritual wickedness in high places.
American King James Version×; 1 Peter 5:8 1 Peter 5:8Be sober, be vigilant; because your adversary the devil, as a roaring lion, walks about, seeking whom he may devour:
American King James Version×). All of these factors serve to strengthen us spiritually, for we grow in strength by resisting the forces of evil.
Has God left us to suffer the consequences of sin without any hope? No, He hasn't. He provided us with a way to obtain forgiveness for sin, through repentance and accepting the sacrifice of His Son, Jesus Christ (Acts 2:38 Acts 2:38Then Peter said to them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and you shall receive the gift of the Holy Ghost.
American King James Version×). His plan enables us to develop genuine character at the same time as it provides us with a way to escape the death penalty that sin brings on (Romans 6:23 Romans 6:23For the wages of sin is death; but the gift of God is eternal life through Jesus Christ our Lord.
American King James Version×).