As a member of The Church of Jesus Christ of Latter-day Saints, I believe that Joseph Smith was a true prophet of God. Through Joseph Smith, God revealed the following:
Doctrine and Covenants 93:29
29 Man was also in the beginning with God. Intelligence, or the light of truth, was not created or made, neither indeed can be.
It is doctrine of the church that when God created our spirits, he created it from two things, 1. Spirit Matter and 2. eternal intelligence.
The above verse speaks of eternal intelligence and tells us that our intelligence has always existed and is self existent. What this is saying is that God did not create our intellect and that it, just like God, has eternally existed. The spirit body was created from a more pure and fine substance we call spirit matter. This spirit matter was combined with our self-existing intelligence to make up our spirits. We believe that our spirits were all created prior to coming to this earth through the procreation process of God. In other words, we are the literal offspring of God. He is literally our Father in Heaven. However, the intelligence within our spirits has always existed. Thus God could never create it and thus he could never create it to be perfect. It was in the state it was in prior to us being born on this earth. God cannot create something that is self-existing. The above verse teaches that our intelligence in self-existing and was never created or made. Here is another verse that informs us that our spirit bodies are made up of spiritual matter:
Doctrine and Covenants 131:7-8
7 There is no such thing as immaterial matter. All spirit is matter, but it is more fine or pure, and can only be discerned by purer eyes;
8 We cannot see it; but when our bodies are purified we shall see that it is all matter.
So in summary, because our intelligence could not be created or made by God, He could not create it to be perfect. Yes, we have always existed as an intelligence. We do not know what an intelligence looks like but we know that our intelligence is not as advanced as God. Since God could not create our intelligence, the only way for it to progress is for it to go through experience and learning. God placed us on this earth to learn good from evil and to experience more joy through having a physical body just as God knows good and evil and has a resurrected body. When resurrected we will be able to receive a fulness of joy.
Doctrine and Covenants 93:33
33 For man is spirit. The elements are eternal, and spirit and element, inseparably connected, receive a fulness of joy;
Free will plays a major part in our progression. Nobody makes God be a good being. He chooses to be a good being in and of himself. God gives us free will so that we too can learn to be a good being and make the right choices in and of ourselves. You cannot become a good being by force. This is why Satan, who wanted to force us all to be good had a faulty plan. You can only be a truly good being by choosing in and of yourself to be a good being. Since God could not create us to be perfect, He needs to try and get us to choose to be a good being of our own volition. In the premortal world of spirits, we all wanted to become like our Father in Heaven and God provided a means whereby we could achieve that goal. However, it requires that we choose of our own free will and choice to be a good being. We need to be converted to choosing good over evil. All who come to this earth and receive a body did not rebel against God in the premortal world of spirits. We chose to side with God in the war in heaven. Those who sided with Lucifer (Satan) were denied the opportunity to receive a body of flesh and bones but were cast into this earth to try and test us to see if we would choose good over evil. Those evil spirits can only tempt us but never force us to be evil. Thus we truly have free will to be either a good being or a bad one. So this is our belief as to why God could not create us to be perfect from the beginning. There is a part of man that is self-existing and the only way for us to become like our Father in Heaven is to choose in and of ourselves to be so. Thus we come to the world of hard knocks to make that choice and overcome evil and experience good and evil that we might better appreciate the good. God, in his wisdom, has found that this is the best way to progress and only those who choose to be good of their own free will and choice will become like God. Those who choose otherwise will reap the rewards of their choices.