It's a valid question that pulls great weight. Many want to say that man was not created perfect. If man had been created perfect, he would not have had weakness enough to disobey and eat of the fruit of the tree of the knowledge of good and evil. Yet, man did eat the fruit of the one tree forbid of him and as punishment death, destruction, and sorrow entered the world.
It is important to understand that the Bible does not state that in creation we were created perfect. Rather, it says that we were created (???) towb; which means good, acceptable, or ethical.
We were not created perfect in the sense that we had no weakness. For if we had no weakness, we would have no need of God. in great contrast, the Bible is clear to show us just how weak we are so that we may know how surely we need God.
When the Bible says we were created good it means that we were morally correct, one could even say that we were holy. It was this moral state of man that was his perfection at creation, it was not a total and unconstrained perfection in which we were devoid of any flaws whatsoever.