To ask why God created us with sin in the world is a perpetual question for theologians and laity alike. When we look at the world and recognize that a holy and infinitely perfect God has created us, we can appreciate His majesty and wonder. But, it is impossible for us to ignore the fact that this world is far from perfect. There is sin in it. Why, then, if God is infinitely perfect and powerful, did He create a world and allow the fall to occur, to contaminate it?
The Bible doesn't give us a specific answer to this question, but I would like to offer this possible answer as food for thought.
God did not lack anything in Himself that prompted His creative act. He wasn't lonely or bored. To say such a thing about Him would be to imply He is not eternally self-sufficient and perfect. But, if God is perfect and doesn't need anything, why would He then create us, the ones that have fallen into sin, and the universe in which we live? What purpose would it serve?
I suspect the answer lies within God's nature and a few clues spread throughout God's Word. To begin with, God is love (1 John 4:16), and the nature of love is to give. John 3:16 says, "For God so loved the world He gave His only begotten Son . . . " I cannot help believing that the most natural quality of love is to give, to be other-centered, and, according to Jesus' own words, to give of one's self to the point of death. John 15:13 is where Jesus said, "Greater love has no one than this, that one lay down his life for his friends."
According to Jesus, there is no greater demonstration of love than self-sacrifice to the point of death. Since God is love (1 John 4:16) and there is none greater than He, I conclude that God can and will be the one who demonstrates the greatest act of love. I cannot see God allowing a mere creation to demonstrate this in a better way than He. It would be a necessary outcome of His own nature and a necessary manifestation in any universe He created that the two greatest commandments referenced by Jesus to love God and love your neighbor would be supremely demonstrated by none other than God Himself. Jesus was God in flesh who loved the Father perfectly, and He loved us completely by laying down His life for us. This is the greatest and most perfect act of love according to Jesus.
If this is true, then it just might be that God had to create the universe so that the fall would be included in His plan for the very purpose of demonstrating and manifesting His perfect character: Love! To demonstrate the very greatest part of His nature of love, He would have to die for someone else. This could not be done if there was no one for whom to die and no reason to die for them. There could be no reason to die if there were no need for an atonement. There would be no need for an atonement if there were no sin. If there was no fall, there would be no sin.
Therefore, perhaps it is possible that God created the universe with "free will" creatures in it who would fall into sin. Without this fall, ultimately no death would be necessary to atone for them, and without that death, the greatest act of love could not be demonstrated. Also, this would mean that the truest and most perfect quality of love would not be fulfilled. Would this then mean that God would not be perfectly fulfilled without having given of Himself? I don't know. But I can't help wondering that for God to truly express His perfectly loving nature, He Himself had to be one who laid His life down for others. For this to happen, He allowed sin to exist in this world.
Furthermore, I suspect that it was Jesus Himself in the garden who walked with Adam and Eve. I base this upon Jesus' own words in John 6:46 where He states that no one has ever seen the Father. Yet, we know that God appeared in the Old Testament (Gen. 17:1; 18:1; Exodus 6:2-3; 24:9-11; Num. 12:6-8; Acts 7:2; etc.). If it was God who was seen and it wasn't the Father, then it must have been Jesus. Why do I bring this up? Because after Adam and Eve sinned, God Himself (Jesus?) shed the blood of an animal in order to cover them with animal skins. This shedding of blood was instituted by God as a prophetic typology of the true and final sacrifice that God (Jesus) would carry out so many thousands of years later when He laid His life down as the perfect demonstration of His loving character. The redemption of mankind was always in the mind of God and was planned and carried out by God as a manifestation of the eternal love He has for His people. This love was made complete in the death of Christ. Also, I suspect that this is what is hinted at in Heb. 13:20 with the reference to the "blood of the eternal covenant" that some theologians think is a reference to God's eternal plan of salvation made within the Trinity before the universe was made. This covenant was the inter-Trinitarian arrangement to redeem mankind through the sacrifice of Christ.
Therefore, I conclude that God may very well have made a universe in which He allowed sin to exist so that He Himself could show the greatest and most perfect act of love by laying down His life for His friends.