No doubt the Prophet ﷺ said “I was sent to perfect good character”, which is one of the key factors of peaceful coexistence in our social environment and relationships, in any given human society. However, the hadith does not mean that he was only sent for that purpose, but that this purpose of good morals and behavior fulfills the greater purpose of Dawah i.e. spread of Islam and invitation for all towards the path of guidance, the way of Allah ﷻ. Especially when doing Dawah (invitation) towards Islam, one should always be mindful of this essential factor because it makes the mission much more effective and inspiring. The best example of this given in the Quran is when Allah ﷻ commanded Prophet Musa (alaihi salaam) to visit and invite Pharaoh towards guidance and Islam:
(Al Quran 20:43–44) Go, both of you, to Pharaoh, for he has exceeded all bounds. Speak to him gently so that he may take heed, or show respect.
Despite the fact that Allah ﷻ knew Pharaoh had “exceeded all bounds”, He still advised Musa (alaihi salaam) and his brother Haroon (alaihi salaam) to be at their best in behavior and character when delivering His Message because our behavior impacts what we are delivering. Since Prophet Muhammad ﷺ knew this very well, his emphasis on improving human behavior was the greatest, keeping in mind the fact that after his passing away, Muslims bear the responsibility to deliver the message in its correct form to those who are ignorant i.e. Non-Muslims as well as Muslims.