Ok look. Lets take Gold for example. When gold is usually found it usually has to be melted and heated over and over so the crap stuff can float to the top and so the good part remains. Take pearls for example. They just don't exist but they come from the sand or whatever that irritates oysters or clams (whichever one they come from.) In both instances something has to undergo a change so something valuable can come from it.
See, we may view perfection as something we start out with or should start out with, but for us humans perfection can be a state of evolving and refinement, and I don't mean by reincarnation or evolution. What I mean is we have to go through certain things, experience certain things to the point where God sees we are ready to be changed (because he is the one who is going to change us.) Think about gold and pearls again.
One person may see perfection as something we start out with and ask, "why did god do this if...", but true perfection for us may not be something that just is (in regards to us.) It can be Gods glory and how we will be made better when it is time.