The origin of idolatry is a fascinating study in and of itself. Maimonides traced the origin of idolatry to the pre-Diluvial era of Enosh. Maimonides writes:
During the days of Enosh, humankind made a serious mistake, and the wise men of that generation gave foolish advise. Enosh himself was one of those who erred. Here is what developed: They said for as much that God created the stars and the celestial planets with which to control the world. He placed them on high and treated them with honor, making them servants who minister before Him. Therefore, it is only fitting to praise and glorify them and to accord them with honor. The ancients perceived this to be the will of the Blessed Holy One, that they aggrandize and give homage to those whom He magnified and honored. Just as a king desires to be honored by the servants who stand before him. Indeed by doing so, they thought they were in fact honoring the King. After considering this notion, they began to construct temples to the stars and offered sacrifices to them. The ancients would praise and glorify the heavenly hosts with words while prostrating themselves before them, because by doing so, they thought they would be fulfilling God’s will. This was the essence of idolatry, and the justification given by those who worshiped them. Originally, the ancients did not say there is any other god except for this star. . . .
Maimonides contends that the ancients eventually forgot about the one true God. It was far easier for them to believe in what was visible rather someone or something that was invisible. They assumed that all the celestial powers were vested in whatever representation they chose to worship.
Some theories dating back to the ancient Greeks proposed an equally intriguing theory about the origin of religion. The founder of atomism, Democritus (ca. 460?-370? BCE), was among the first thinkers to suggest that the gods were nothing more than physical phenomena that appear to mankind, and only “appeared” to speak. This belief arouse from early man’s terror of the solar eclipse, thunder, and so on. The belief in these “deities” made it necessary for the ignorant, ethically stunted to refrain from wrongdoing only through the fear of punishment, and not because they regarded morality as essential for their happiness.
In some of Plato’s writings, the famed philosopher felt that the belief in gods were necessary, in order to curb human wickedness and corruption. The belief in gods presupposed there is an order to the universe, and if there were indeed no gods, then the order of the heavens must be an accident.  Several other Greek and Roman thinkers saw a kinship between superstition and religion. In its earliest Latin literary usage by Plautus and Ennius, superstitio was already a negative term describing divination, magic, and “bad religion” in general. Cicero gives a concrete example, explaining that “those who spent whole days in prayer and offered sacrifices, that their children might outlive them, are called superstitious” .
For classical Roman observers like Seneca, Lucretius, and Cicero, and Livy superstition meant erroneous, false, or excessive religious behaviors stemming from ignorance of philosophical and scientific truths about the laws of nature. Such ignorance was associated with the common people (vulgus) and with the countryside (pagus), so that superstitious behavior as practiced by simple old men and women.
In Cicero’s On Divination, the philosopher concludes that religion was useful because it helped to control human behavior and could be used as a tool for public policy; and in this context divination could be useful too (as when an unwise political decision was prevented by the announcement that the omens were unfavorable). To many of these thinkers, the ancients “invented” the belief in gods as “a noble lie,” a necessary crutch (or as an “illusion” as formulated by Freud) or simple and ignorant people to believe that these deities have the means for securing blessing and avoiding disaster.
 Maimonides, MT Hilchot Avodat Kokavim 3:9
 Plato, Republic III, 414b.
 Cicero, On the Nature of the Gods 2.28