He it is Who raised among the inhabitants of Mecca an Apostle from among themselves, who recites to them His communications and purifies them, and teaches them the Book and the Wisdom, although they were before certainly in clear error. (Surah Jumah 62:2)
Quranic verses like the one quoted above and traditions of Ahle Bayt show that the primary aim of sending the Prophets was to teach and train the people and to purify them.
These two things themselves have a special aim. Training and purification of self is indispensable to the perfection of humanity. They are so closely related to each other that they cannot be separated. Both of them are required to achieve the perfection of human beings. Without them, humanity will not reach to perfection. If this were not true the Almighty Allah would not have made the aim if His Prophets as such.