The Neolithic/Agricultural Revolution that took place roughly around 12000 years ago was a cornerstone in shaping the pre-modern/modern world; an impetus transcending the hunter-gatherer lifestyle to sedentary specialized societies.
The cultivation of food crops and domestication of animals meant that the wandering ways for survival were no longer necessary. Life wasn’t all about survival. There was time, to find a higher purpose of life; creativity, art, spirituality, political and social organizations as well as scientific development, which in conjunction with that carried down over the millennia flourished cultural and lifestyle values.
The oldest temple yet discovered is the Göbekli Tepe, situated about 15km Northeast from the city of Sanliurfa in Southeastern Turkey and is believed to have been built around 10000 BCE. The ruins of the site suggest that the complex religious practices and rituals had already been well established and was already an essential aspect of life, long before the settlement took place.
Charles C. Mann, in his “The Birth of Religion” in the National Geographic Magazine goes on to say that it might have been “the urge to worship” that actually sparked civilization and settlement and rather than the other way round.