God made us because He loved us, and He wanted us to love Him in return. The Bible says that in the beginning, before sin ever entered the world, Adam and Eve enjoyed a perfect, unbroken relationship with God.
What went wrong? Perhaps you know what happened: Satan tempted Adam and Eve to turn against God and disobey Him –and they did. Although they had been warned of the consequences, they still believed Satan when he called God a liar and told them instead that "You will not surely die" (Genesis 3:4). From that moment on, sin–like a deadly cancer–invaded their souls and severed their relationship with God. It also brought death and human selfishness into the world.
Why didn't God make us so we couldn't sin? The reason is simple: Then we would have been like puppets, unable to choose between right and wrong. Our love for God wouldn't have been genuine either, because we couldn't have freely chosen to love God. Love is real only when we can choose it.
Did God know what would happen? Yes, He did; the Bible says that God planned our salvation even "before the creation of the world" (Ephesians 1:4). And the good news is that we don't need to fear God's judgment any longer, because Jesus Christ opened Heaven's door to us by His death on the cross. Is your faith and hope in Him for your salvation?