The Attributes of God
#1 God is Love
#2 God is perfect
#3 God is good.
#4 God is infinite (not actually correct -God is more than infinite but we can't understand that.
#5 God is unique. There is only one God and there can only be one God.
By virtue of what love is, it creates. Therefore God, by virtue of who He is created the universe and everything in it including angels, animals, and humans.
God is perfect, therefore everything he does must be done perfectly in the context of who God is.
God is good, not only is God good, but He is perfectly good.
By virtue of #1, God must create. God did not need to create in order to improve Himself, but He must create by the nature of what infinite love is. If God had not created, His love would not have been infinite.
So, why didn't God create a perfect universe, one without evil?
God created man in His image, but not identical. If He had created man identically to Himself, man would be a clone of God and God would no longer be unique which would violate attribute #5.
But God is perfect, therefore must He create everything perfectly?
Because God is love he must create, but his creation must be accomplished in such a way that it does not violate any of His attributes. God created man perfectly but not perfect. In order for God to create man in His image, while maintaining His uniqueness, He created man less than perfect.
Where is the proof?
Genesis 1:31
Then God saw everything that He had made, and indeed it was very good. So the evening and the morning were the sixth day. KJV
This verse tells us that God's creation was VERY good, but not perfect and, as God had not yet rested from creation He could have made it perfect if possible. It is arguable that God did not create evil, He merely created a universe where evil was not excluded. That will be taken up at another time.