It seems that when Allah created Adam, and gave him the human nature, Allah understood what Adam would do and that eventually Adam would come to this world, and that this was part of the plan of the creation of the human being, as well as something for us to learn from about our own nature.
Otherwise, if this process had not continued, and human beings were still living in the garden, we would not be dealing with the complexities of this world that enable it to fulfil its spiritual function for us - for instance, refining the soul, learning about things and their opposites (such as mercy and lack of mercy, knowledge and ignorance), developing the soul, testing the soul, and overall experiencing the world of matter and the material world. We would just be like children in the womb who are provided for and are secure but who are not growing beyond their confines.
Perhaps, one can also learn from this that our actions change us. Even if Adam's repentance was accepted, he was still a different person after what he did and therefore had a different life path.
Also, Allah says in the Qur'an that Allah loves those people who repent/turn back to Him (2:222). It is narrated that the Prophet (S) said: “Had you not committed sins and sought the forgiveness of Allah, He would have created others who commit sins and then seek His forgiveness so that He will forgive them. A believer commits sins frequently, but repents to Allah very frequently."
So it seems that the human being was created in such a manner that it is expected that we will need to continually turn back to Allah, even though of course we should not be making mistakes intentionally.
As for the overall purpose of life in this world, this of course is a question that people have debated since the beginning of time. From the Qur'an and hadith, one can understand that the purpose of being in this world includes cognizance and worship of Allah, learning about greater realities, growth, and testing the soul.
One can also consider that there is an overall purpose of existence of humanity in general, and each of us may also have our own individual purposes; for instance, I am sure that my purpose in life is not to become an Olympic runner (at least, I have not yet shown any talent in this area), but perhaps my personal purpose is something else.