A - Worshipping Allah Alone:
This is the reason for which Allah created all that exists: Angels, Jinn, mankind, heavens, earth and animals etc. Allah created everything only to worship Him Alone. He Said, (what means): "Do you not see that to Allah prostrates whoever is in the heavens and whoever is on the earth and the sun, the moon, the stars, the mountains, the trees, the moving creatures and many of the people? But upon many the punishment has been justified. And he whom Allah humiliates - for him there is no bestower of honor. Indeed, Allah does what He wills." [Quran 22:18]
Allah also said about the Angels, (what means): “Indeed, those who are near your Lord are not prevented by arrogance from His worship, and they exalt Him, and to Him they prostrate..” [Quran 7:206].
Allah further Says (what means): "The seven heavens and the earth and whatever is in them exalt Him. And there is not a thing except that it exalts [Allah] by His praise, but you do not understand their [way of] exalting. Indeed, He is ever Forbearing and Forgiving. " [Quran17:44]
There are many other verses with this meaning.
Allah sent the Prophets, may Allah exalt their mention, and sent down revelations to them for the above reasons. He said, (what means): "And We certainly sent into every nation a messenger, [saying], "Worship Allah and avoid aghut." [Quran 16:36]
Prophet Muhammad sallallahu ‘alayhi wa sallam, (may Allah exalt his mention), was the last Messenger sent by Allah to all nations, with the goal of worshipping Allah Alone. He commanded people to worship Allah Alone, taking no partners with Him in worship.
B - Establishing Allah's Proof:
The most important role for the Messenger, sallallahu ‘alayhi wa sallam, is to warn the disbelievers and rebellious Muslims. Allah Says, (what means): "Indeed, We have revealed to you, [O Muhammad], as We revealed to Noah and the prophets after him. And we revealed to Abraham, Ishmael, Isaac, Jacob, the Descendants, Jesus, Job, Jonah, Aaron, and Solomon, and to David We gave the book [of Psalms]. And [We sent] messengers about whom We have related [their stories] to you before and messengers about whom We have not related to you. And Allah spoke to Moses with [direct] speech. [We sent] messengers as bringers of good tidings and warners so that mankind will have no argument against Allah after the messengers. And ever is Allah Exalted in Might and Wise." [Quran 4:163-165]
What Allah meant by (what means): "so that mankind will have no argument against Allah after the messengers." is that, on the Day of Judgment, they will not be able to use the excuse of not having a warner from Allah during their lifetimes. This excuse will not justify their continuing disbelief. The fact that Allah has sent the Messengers, may Allah exalt their mention, will invalidate all excuses that the disbelievers may use on the Day of Resurrection.
Allah says to His Messenger, may Allah exalt his mention, (what means):"Your duty is to convey (the Message)." [Quran 42:48]. And (what means): "The Messenger's duty is but to convey the Message." [Quran 5:99] This applies to the Message of the Prophet to the disbelievers. He only had to deliver the Message that Allah sent him with, explain to them their obligations to Allah and warn them of eternal torment if they insisted on rebellion and disbelief.
Allah says, (what means): "Say, "Obey Allah and obey the Messenger; but if you turn away - then upon him is only that [duty] with which he has been charged, and upon you is that with which you have been charged. And if you obey him, you will be [rightly] guided. And there is not upon the Messenger except the [responsibility for] clear notification." [Quran 24:54]
This Ayah (verse) explains the goals of the Message, the essence of what it contains and the role of the Messenger, sallallahu ’alayhi wa sallam, and the community he was sent to. The role of the Messenger, sallallahu ‘alayhi wa sallam, was to deliver the Message, and the role of those receiving the Message was to hurry to the obedience of Allah and His Messenger, sallallahu ‘alayhi wa sallam; if they refused then Allah's punishment will be justly theirs.
Allah Says, (what means): " Say, "What would my Lord care for you if not for your supplication?" For you [disbelievers] have denied, so your denial is going to be adherent." [Quran 25:77] This means that the punishment of Allah will certainly be felt by those who reject the Message of the Prophets, may Allah exalt their mention, after being aware of them.
C - Establishing a Muslim Nation:
Allah Says, (what means): "It is He who has sent among the unlettered a Messenger from themselves reciting to them His verses and purifying them and teaching them the Book and wisdom - although they were before in clear error" [Quran 62:2]
The Message of Prophet Muhammad was a fulfillment of the prayers of Ibraaheem (Abraham) and Ismaa'eel (may Allah exalt their mention. They said, while raising the building of the Kaa'bah in Makkah (what means): "Our Lord, and send among them a messenger from themselves who will recite to them Your verses and teach them the Book and wisdom and purify them. Indeed, You are the Exalted in Might, the Wise." [Quran 2:129]
Allah accepted their prayer and sent this honorable Prophet Muhammad, sallAllahu ‘alayhi wa sallam, and established for him the best nation ever, as Allah Himself proclaimed (what means): "You (true believers in Islam) are the best of peoples ever raised up for mankind, you enjoin righteousness and forbid evil, and you believe in Allah." [Quran 3:110]
Allah praised the Prophet's companions, may Allah be pleased with them, in many verses in the Quran, (which mean) : "Muhammad is the Messenger of Allah; and those with him are forceful against the disbelievers, merciful among themselves. You see them bowing and prostrating [in prayer], seeking bounty from Allah and [His] pleasure. Their mark is on their faces from the trace of prostration. That is their description in the Torah. And their description in the Gospel is as a plant which produces its offshoots and strengthens them so they grow firm and stand upon their stalks, delighting the sowers - so that Allah may enrage by them the disbelievers. Allah has promised those who believe and do righteous deeds among them forgiveness and a great reward." [Quran 48:29]
D - Making Islam (The Message Of Allah) Dominant:
The fourth reason for sending Prophet Muhammad, sallallahu ‘alayhi wa sallam, is to establish Islam as the dominant religion above all, till the Day of Judgment. Allah Says, (what means): "It is He who sent His Messenger with guidance and the religion of truth to manifest it over all religion. And sufficient is Allah as Witness." [Quran 48:28]
Allah also Says (what means): “It is He who has sent His Messenger with guidance and the religion of truth to manifest it over all religion, although they who associate others with Allah dislike it." [Quran 9:33]
To establish Islam means to make its domination clear above all religions. Allah made this promise a reality whenever the Muslims sought victory, equipped with the right belief. A look at the past will show that Muslims conquered all the powers and religions of the world by using their reasoning first, and then using the sword. - islamweb.net