Those who follow whims and desires are the people of dispute and division
Question

Why is Islam divided into a number of sects, such as the Shi‘ah, Sunnis and Salafis?
Praise be to Allah.Firstly: 
What should be understood is that Islam is a religion of unity. It teaches the Oneness of Allah (Tawheed), which is the fundamental principle of this religion, and it enjoined all people to unite on that and cast away anything that may lead to conflict and division, and it emphatically forbade splitting and differing from one another. Allah, may He be exalted, says (interpretation of the meaning):
“And hold fast, all of you together, to the Rope of Allah (i.e. this Qur’an), and be not divided among yourselves, and remember Allah’s Favour on you, for you were enemies one to another but He joined your hearts together, so that, by His Grace, you became brethren (in Islamic Faith)”
[Aal ‘Imraan 3:103].
Then after that He, may He be exalted, said (interpretation of the meaning):
“And be not as those who divided and differed among themselves after the clear proofs had come to them. It is they for whom there is an awful torment”
[Aal ‘Imraan 3:105].
And He, may He be glorified, said (interpretation of the meaning):
“And obey Allah and His Messenger, and do not dispute (with one another) lest you lose courage and your strength departs, and be patient. Surely, Allah is with those who are As‑Saabiroon (the patient)”
[al-Anfaal 8:46]
“and be not of Al‑Mushrikoon (the polytheists, idolaters, disbelievers in the Oneness of Allaah).
Of those who split up their religion (i.e. who left the true Islamic Monotheism), and became sects, [i.e. they invented new things in the religion (Bid‘ah), and followed their vain desires], each sect rejoicing in that which is with it.”
[ar-Room 30:31, 32].
Hujjat al-Qiraa’aat (278) and Tafseer al-Qurtubi (14/32).
It was narrated from Ibn Mas‘ood that the Prophet (blessings and peace of Allah be upon him) said: “Do not differ, for verily those who came before you differed and thus they were doomed.” Narrated by al-Bukhaari (3476). 
Al-Haafiz (may Allah have mercy on him) said: 
This hadeeth encourages us to be united and in harmony, and is a warning against division and dissent. It is a prohibition against arguing about the Qur’an unjustifiably. Even worse than that is when a verse indicates a meaning that is different to a person’s own opinion, then you find him trying hard to interpret it in a manner different from what it appears to mean, so that the meaning will be in harmony with his own opinion, and he will end up arguing in support of his opinion and persisting in that. End quote. 
It was narrated that al-Bara’ ibn ‘Aazib said: The Messenger of Allah (blessings and peace of Allah be upon him) used to enter between the rows from one side to the other. He would touch our chests and shoulders and say: “Do not differ, or else your hearts will differ.”
Narrated by Abu Dawood (664); classed as saheeh by al-Albaani in Saheeh Abi Dawood. 
Ibn Maajah (85) narrated that ‘Abdullah ibn ‘Amr said: The Messenger of Allah (blessings and peace of Allah be upon him) came out to his companions when they were disputing about the Divine decree, and it was as if pomegranate seeds had burst on his face (i.e., it turned red) because of anger. He said, “Have you been commanded to do this, or were you created for this purpose? You are using one part of the Qur’an against another part, and this is what led to the doom of the nations who came before you.”
Classed as saheeh by al-Albaani in Saheeh Ibn Maajah (1/157) 
It was narrated that ‘Arfajah ibn Shurayh said: I heard the Messenger of Allah (blessings and peace of Allah be upon him) say: “There will be fitnah and innovations. Whoever wants to divide this ummah when it is united, strike him with the sword, no matter who he is.”
Narrated by Muslim (1852). 
The texts that speak of this matter are too many to be counted. Our aim here is to point out that Islam does not call for division; rather it calls for the opposite of that, namely harmony and unity, but that should only be by uniting on the truth. This is the only way to unite. 
It is stipulated that unity should be upon the truth and solving disputes should be done on the basis of the truth, because people are influenced by their whims and desires, and they have different backgrounds, and therefore their understanding of different issues of Islam may vary, but the one who seeks the truth on the basis of sound evidence will find it, clear and free of any defects. 
The Prophet (blessings and peace of Allah be upon him) spoke of the condition of his ummah after he was gone, as he said: “I enjoin you to fear Allah and to hear and obey, even if it be an Abyssinian slave. Whoever among you lives after I am gone will see great disputes; you must adhere to my Sunnah and the way of the Rightly Guided Caliphs. Hold on to it and cling fast to it. And beware of newly-invented matters, for every newly-invented matter is an innovation and every innovation is a going astray.”
Narrated by Abu Dawood (4607) and Ibn Maajah (44); classed as saheeh by al-Albaani in Saheeh Ibn Maajah. 
According to the report of Ibn Maajah: “I am leaving you on a clear day whose night is like its day. No one will deviate from it after I am gone but one who is doomed. 
So he instructed us to adhere to the Sunnah as a religious obligation. He affirmed that differences would arise in the ummah as part of Allah’s decree, but these differences should be resolved in the light of sharee‘ah, and he described newly invented matters as misguidance, and this is in harmony with the texts quoted above. 
It is not Islam that is divided into sects that differ from one another and oppose one another; rather it is the people who differ according to how far away they are from the religion and the extent to which they have abandoned the Sunnah of their Prophet and followed their whims and desires. 
It was narrated Ibn Maajah (3992) and Ibn Abi ‘Aasim in as-Sunnah (53) that ‘Awf ibn Maalik al-Ashja‘i (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “The Jews split into seventy-one sects, one of which will be in Paradise and seventy in Hell. The Christians split into seventy-two sects, seventy-one of which will be in Hell and one in Paradise.  By the One in Whose hand is my soul, my ummah will split into seventy-three sects, one of which will be in Paradise and seventy-two in Hell.” It was said: O Messenger of Allah, who are they? He said: “The jamaa’ah (the main body of the Muslims).”
Classed as saheeh by al-Albaani in as-Saheehah (1492). 
According to another report: “The (path) on which I and my companions are.” Narrated and classed as saheeh by at-Tirmidhi (2641). 
Secondly: 
Ahl as-Sunnah, or the Salafis – as these are synonymous – are the ones who are steadfast in following the Book of Allah and the Sunnah of His Prophet (blessings and peace of Allah be upon him), and following the teachings of the righteous early generations in their words, actions and conduct. This is one of the bases of the differences between them and other groups. What I mean is that they refer everything to the text of the Qur’an and Sunnah first of all, especially in matters of belief, and they follow the approach of the righteous early generations in all of that. They give precedence to all of that over human thought and philosophical ideas concerning that which is beyond human minds of matters of the unseen. 
Please see the answer to questions no. 6280 and 10121 
And Allah knows best.