Past work suggested that the rise of this idea of cosmic enforcement of morality was associated with social complexity. The concept of supernatural judgment evolved to help strangers in large societies cooperate, researchers hypothesized. Some work, such as analyses of Austronesian religions or of the Viking age in Scandinavia, suggested that moralizing gods preceded complex societies, while other research, such as a study of Eurasian empires, found that moralizing gods followed the rise of complex societies.There are too many questions being begged here for me to accept this as definitive, but it certainly is an interesting finding. I consider this to be one of the most important under-discussed problems of human history: when and why did the gods become moral beings concerned with the moral behavior of humans? After all in many mythologies, gods are neither good nor bad, just powerful; in fact many civilizations seem to lack any sense of "good" and "evil" on a cosmic scale. So far as I know the first person to imagine that the universe was the scene of a cosmic battle between good and evil, and that we are all called upon to choose the good side, was the Persian prophet Zarathustra, around 1400 BC.
But those studies were limited in geographic scope and hampered, at times, because historians lacked detailed information on the complexity of societies at given points in history, said Patrick Savage, an anthropologist at Keio University in Kanagawa, Japan. In the new study, Savage and his colleagues sought to overcome these limitations using the Seshat: Global History Databank, a database of information about global history from the end of the Paleolithic period up to the Industrial Revolution.
The scientists analyzed the relationship between social complexity and moralizing gods in 414 societies spanning the past 10,000 years from 30 regions across the globe. Researchers examined 51 measures of social complexity, such as the size of the largest settlement and the presence of a formal legal code, and four measures of supernatural enforcement of morality, such as the concept of a supernatural force that monitors and punishes selfish actions.
The researchers found that belief in moralizing gods usually followed increases in social complexity, generally appearing after the emergence of civilizations with populations of more than about 1 million people.
My basic sense is that the evolution of modern, moralistic religion was a long, complex process. The first rules are ritual and tribal: we do this [long list of strange practices] for our gods so they will smite our enemies instead of us. Then particular shrines come to be considered especially holy, so that killings in them are murders offensive to the gods; it comes to be an anti-religious act to break an oath sworn on hold objects; the list of rules that a godly person must follow comes to include things like treating your spouse properly and feeding the hungry. And so on, until the world is wrapped in an all-encompassing cocoon of divine watchfulness and divine law.
You can see some of this change being worked out in the dialogues of Plato, where Socrates asks hard questions of the traditional Greek gods and their philandering, vengeful, violent ways. A huge amount of ink has been spilled over when the God of the Hebrews became a moralist, and the bulk of opinion points to the era of Exile around 500 BC; the story of Jonah being sent to preach to the Assyrians is often seen as a claim for universal religion and universal religious morality. In India religious philosophy took a different route, and rather than reforming the gods of the old epics they were turned into something like symbols of a deeper reality.
Somehow this does seem to be related to the stages of civilization: belief in an all-encompassing moral code enforced in some sense by all-seeing gods is a very common attribute of state-level civilizations. You can see the triumph of Christianity and Islam as the culmination of this process.
Everywhere except East Asia, which is rather different. Buddhism certainly teaches a universal morality with a cosmic enforcement mechanism, but Buddhism never dominated China or Japan like Christianity did Europe. In Asia Buddhism existed side-by-side with ancient ritual systems and shamanistic practices that made no particular moral claims. So the question is complicated, like everything else about human history. But I think the general pattern is pretty clear.
Many contemporary believers worry that as belief in the divine punishment of sin fades from our secular world, morality will be corroded and civilization will eventually collapse. As I have said here many times, I find that religious belief and morality are two very separate things; after all we had moral codes before we had angry gods, and I imagine we can keep having them after we have stopped fearing divine wrath.