The Origins of Shirk
From that which has been established in the shari'ah (prescribed law) is that mankind was - in the beginning - a single nation upn truetawhid, then shirk (directing any part or form of worship, or anything else that is solely the right of Allah, to other than Allah) gradually overcame them . The basis for this is the saying of Allah, the Most Blessed, the Most High:-
"Mankind was one Ummah, then Allah sent prophets bringing good news and warnings." [Al-Qur'an 2:213]
Ibn 'Abbas, may Allah be pleeased with him, said, "Between Noah and Adam were ten generations, all of them were upon shari'ah (law) of the truth, then they differed. So Allah sent prophets as bringers of good news and as warners." 
Ibn 'Urwah al-Hanbali (d. 837H) said, "This saying refutes those historians from the People of the Book who claim that Cain and his sons were fire-worshippers." 
I say: In it is also a refutation of some of the philosophers and atheists who claim that the (natural) basis of man is shirk, and that tawhidevolved in man! The preceeding ayah (verse) falsifies this claim, as do the two following authentic hadith:-
Firstly: His saying that he related from his Lord (Allah), "I created all my servants upon the true religion (upon tawhid, free from shirk). Then the devils came to them and led them astray from their true religion. They made unlawful to people that which I had made lawful for them, and they commanded them to associate in worship with Me, that which I had sent down no authority." 
Secondly: His saying, "Every child is born upon the fitrah  but his parents make him a jew or a christian or a magian. It is like the way an animal gives birth to a natural offspring. Have you noticed any born mutilated, before you mutilate them?" 
Abu Hurayrah said, "Recite if you wish:-
'Allah's fitrah with which He created mankind. There is to be no change to the creation (Religion) of Allah.' " [Al-Qur'an 30:30] 
After this clear explanation, it is of the upmost importance for the Muslim to know how shirk spread amongst the believers, after they weremuwahhidin (people upon tawhid). Concerning the saying of Allah, the Most Perfect, about the people of Noah:-
"And they have said : You shall not forsake your gods, nor shall you forsake Wadd, nor Suwa', nor Yaghooth, nor Ya'ooq, nor Nasr."[Al-Qur'an 71:23]
It has been related by a group from the Salaf (Pious Predecessors), in many narrations, that these five deities were righteous worshippers. However, when they died, Shaytan (Satan) whispered into their people to retreat and sit at their graves. Then Shaytan whispered to those who came after them that they should take them as idols, beautifying to them the idea that you will be reminded of them and thereby follow them in righteous conduct. Then Shaytan suggested to the third generation that they should worship these idols besides Allah, the Most High, and he whispered to them that this is what their forefathers used to do!
So Allah sent to them Noah, peace be upon him, commanding them to worship Allah alone. However none responded to his call except a few. Allah, the Mighty and Majestic, related this whole incident in Surah Nuh (Noah). Ibn 'Abbas relates, "Indeed these five names of righteous men from the people of Noah. When they died Shaytan whispered to their people to make statues of them and to place these statues in their places of gathering as a reminder of them, so they did this. However, none from amongst them worshipped these statues, until when they died and the purpose of the statues was forgotten. Then (the next generation) began to worship them." 
The likes of this has also been related by Ibn Jarir at-Tabari and others, from a number of the Salaf (Pious Predecessors), may Allah be pleased with them all. In Ad-Durr al-Manthur (6/269) 'Abdullah ibn Humaid relates from Abu Muttahar, who said, "Yazid ibn al-Muhallab was mentioned to Abu Ja'far al-Baqir (d. 11H), so he said, 'He was killed at the place where another besides Allah was first worshipped.' Then he mentioned Wadd and said, 'Wadd was a Muslim man who was loved by his people. When he died, the people began to gather around his grave in the land of Babel, lamenting and mourning. So when Iblis (Satan) saw them mourning and lamenting over him, he took the form of a man and came to them, saying I see that you are mourning and lamenting over him. So why don't you make a picture of him (i.e. a statue) and place it in your places of gatherings so that you maybe reminded of him. So they said: Yes, and they made a picture of him and put in their place of gathering; which reminded them of him. When Iblis saw how they were (excessively) remembering him, he said why doesn't every man amongst you make a similar picture to keep in your own houses, so that you can be (constantly) reminded of him? So they all said yes. So each household made a picture of him, which they adored and venerated and which constantly reminded them of him.' Abu Ja'far said, 'Those from the later generation saw what the (pevious generation) had done and considered that ... to the extent that they took him as an ilah (diety) to be worshipped besides Allah.' He then said. 'This was the first idol worshipped other than Allah, and they called this idol Wadd.' " 
Thus the wisdom of Allah, the Blessed, the Most High, was fufilled, when he sent Muhammed, upon whom be peace, as the final prophet and made his shari'ah the completion of all divinely Prescribed Laws, in that He prohibited all means and avenues by which people may fall into shirk, which is the greatest of sins. For this reason, building shrines over graves and intending to specifically travel to them, taking them as places of festivity and gathering and swearing an oath by the inmate of a grave have all been prohibited. All of these lead to excessiveness and lead to the worship of other than Allah, the Most High.
This being the case even more so in an age in which knowledge is diminishing, ignorance is increasing, thre are few sincere advisors ( to the truth) and Shaytan is co-operating with men and Jinn to misguide mankind and to take them away from the worship of Allah alone, the Blessed, the Most High.
1. Tahdhir as-Sajid min Ittikhadh al-Quburi Masajid, pp.101-106
2. Related by Ibn Jarir at-Tabari in his tafsir (4/275) and al-Hakim (2/546) who said, "It is authentic according to the criterion of al-Bukhari." Adh-Dhahabi also agreed
3. Al-Khawakib ad-Durari fi Tartib Musnad al-Imam Ahmad 'ala Abwab al-Bukhari, 6/212/1, still in manuscript form
4. Related by Muslim (8/159) and Ahmad (4/162) from 'Iyadh ibn Himar al-Mujashi'i, may Allah be pleased with him
5. [From the Editors] Ibn al-Athir said in An-Nihayah (3/457), "Al-Fitr means to begin and create, and al-fitrah is the condition resulting from it. The meaning is that mankind were born upon a disposition and a nature which is ready to accept the true religion. So if he were to be left upon this, then he would continue upon it. However, those who deviate from this do so due to following human weaknesses and blind following of others ... " Al-Hafidh ibn Hajar said in Al-Fath (3/248), "The people differ concerning what is meant by al-Fitrah and the most famous saying is that it means Islam. Ibn 'Abdul-Barr said, 'That is what was well known with most of thesalaf (pious predecessors), and the scholars of tafsir are agreed that what is meant by the saying of Allah, the Most High, 'Allah'sfitrah with which He created mankind' is Islam."
6. Related by Al-Bukhari (11/418) and Muslim (18/52)
7. Related by al-Bukhari (8/534)
8. Related by Ibn Abi Hatim also, as is in al-Kawakib ad-Durari (6/112/2) of Ibn 'Urwah al-Hanbali, along with an isnad which is hasan, up to Abu Muttahar. However, no biography could be found for him, neither in Ad-Dawlabi's Al-Kuna wal-Asma, nor Muslim's al-Kuna, nor any one elses. And the hidden defect here is that he is from the Shi'ah, but his biography is not included in At-Tusi's al-Kuna from the index of Shi'ah narrators.