In general, Scripture teaches us that God created the world and all that is in it for His own glory and because He desired to share His life with others. The creation of all these things demonstrates His glory, His love, grace, mercy, wisdom, power, goodness, etc. Compare Psalm 19:1f; 8:1; 50:6; 89:5. Usually, people want to then know, why did God allow sin?
As a summary of some of the issues, the Bible teaches us God created both the angels and man with volition, or the freedom of choice. He created both as holy and without sin that they might not only serve Him as the Creator, but bring Him glory. In particular, man, being created in God’s image (Gen. 1:26f), was created to have fellowship with God through the exercise of that image. Man was created to glorify God through the exercise of his personality—mind, heart, and will. With his mind he was to know God, with his heart he was to love God, and with his will, in response to his understanding and love of God, he was to choose for God in obedience. But God did not create robots. That would have brought very little glory to God. Because His creatures were not robots, there was the risk of a negative choice. But God, by His sovereign will, purpose, and foreknowledge, determined to allow this, indeed, He ordained it by His own eternal wisdom without Himself being the cause.
Many struggle with this, but in the process of all that has occurred, God’s glory is supremely revealed in all His Holy attributes—His holiness, righteousness, justice, mercy, grace, and love, veracity, truth, etc. God did not cause the creature to sin. If the creature was to really have the freedom to know, love, and choose for God and respond in worship and obedience as a free and independent agent, he had to have true freedom of choice. Thus, compare the temptation of Eve by the devil. He attacked her knowledge and understanding of God to get her to doubt God’s love, etc. The race fell because of Adam and Eve’s negative response to the grace of God. But in the process, God’s character and glory is revealed in a more total or complete way. So, through the cross, man’s sin, like diamonds reflecting the light against the backdrop of black velvet, reflects God’s love, mercy, grace, holiness and justice in infinite ways.
Finally, the Bible clearly shows us that God has perfectly provided for us so that we can be reconciled to Him, walk with Him and even overcome sin’s power through the finished work of Christ on the cross and the many blessing we have in Him. In this regard, there are three aspects or phases to the salvation God offers us in Christ—the past—by faith in Christ, we are saved from the penalty of sin; the present—we are being delivered from the power of sin (if we will walk by faith and in fellowship in Him); and the future—saved once and for all from the presence of sin with the return of Christ. So we can’t blame God. He has made more than sufficient provision for us and our sin problem even to the point of giving us His Son.
For more information on this from the standpoint of why God allowed Satan and sin, see the study on our web site on Satanology: Our Invisible Adversary, the Devil.