Why are human beings not created with a perfect character from the outset?
The Pre-mortal Existence
My denomination teaches that we existed as spirits prior to physical birth. As taught in The Family - A Proclamation to the World:
In the premortal realm, spirit sons and daughters knew and worshipped God as their Eternal Father and accepted His plan by which His children could obtain a physical body and gain earthly experience to progress toward perfection and ultimately realize their divine destiny as heirs of eternal life.
We had not then developed to the point we are at now, and we are not now everything we can become.
My denomination does not believe in creation ex-nihilo with respect to the universe generally or humankind specifically (a brief argument against creation ex-nihilo here, a longer discussion here).
I believe that God creates by organizing, separating, & transforming. In almost every context this is what is meant by the word "create". To create is to take something that already exists and transform it. In another post I wrote about the concept of an "eternal self" - that there is a fundamental part of us that has always existed and will never cease to exist. We are eternal beings: we grow and develop, but we do not begin or end.
Man was also in the beginning with God. Intelligence, or the light of truth, was not created or made, neither indeed can be. (Doctrine & Covenants 93:29)
The elements are eternal (Doctrine & Covenants 93:33)
Some may contend that this discussion of eternity and the infinite is not intuitive. While I grant that infinity is not intuitive, I submit that existing forever in the past is no less intuitive than existing forever in the future.
My faith is unique in its understanding of theosis. We believe that we are the spirit children of God and that we can become like Him. We believe very literally Paul's statement "And if children, then heirs; heirs of God, and joint-heirs with Christ" (Romans 16:9, see also 1 John 3:2-3, Moroni 7:48).
Theologian and former Brigham Young University Dean of Religion Robert Millet has written:
Latter-day Saints do not believe that human beings will ever be independent of God, or that they will ever cease to be subordinate to God. They believe that to become as God means to overcome the world through the atonement of Jesus Christ (see 1 John 5:4—5; Revelation 2:7, 11). Thus the faithful become heirs of God and joint heirs with Christ and will inherit all things just as Christ inherits all things...There are no limitations on these scriptural declarations; those who become as God shall inherit all things (see here p.15)
The Church's statement on the topic can be found in the essay: Becoming Like God.
God's plan is not one in which we were created out of nothing -- some essential part of who we are has always existed and God met us where we were. It is a merciful plan in which it is possible for someone to become more than they were in the past or are in the present. If the only things that could have perfect character were those which started with perfect character, we'd be talking about a much less hopeful plan and a much less powerful God.
Why didn't God create humans with perfect character? Because we already had character and it wasn't perfect. We are eternal beings. God has endowed our "eternal selves" with spiritual & physical faculties, but He has not and does not compel us to change our character. His plan provides us with the opportunity for the transformation of our character, if we are willing.
The great miracle of this plan is not that God creates something that does what He wants it to do, but that He can take someone that does not do what He wants them to do, and develop, teach, lead, and coach them to do as He does of their own volition, and that for those willing to walk that path, God has the power to make them as He is.
This post might naturally lead to follow-up questions about how & why the nature of God is what it is. This appears to be outside the scope of the original question, but may make for a useful follow up question.
Disclaimer: these thoughts are the product of my own study and do not constitute official statements by The Church of Jesus Christ of Latter-day Saints