(This turned out to be a semi-rant.)

I will play "devil's advocate".

The first thing I thought about when the researchers explained this:

Norenzayan thinks this connection between moralizing deities and “prosocial” behavior—curbing self-interest for the good of others—could help explain how religion evolved. In small-scale societies, prosocial behavior does not depend on religion. The Hadza, a group of African hunter-gatherers, do not believe in an afterlife, for example, and their gods of the sun and moon are indifferent to the paltry actions of people. Yet the Hadza are very cooperative when it comes to hunting and daily life. They don't need a supernatural force to encourage this, because everyone knows everyone else in their small bands. If you steal or lie, everyone will find out—and they might not want to cooperate with you anymore, Norenzayan says. The danger of a damaged reputation keeps people living up to the community's standards.

[...]

Norenzayan points out, however, that the complexity of most of the cultures analyzed is limited—they are small-scale chiefdoms, not large agricultural societies.

was tribalism. This seems like they're trying to put a different spin on it. Before political systems were formed, this is how tribe members developed trust within their societies. This is on a low-scale population or society.

The article continues with this:

As societies grow larger, such intensive social monitoring becomes impossible. So there's nothing stopping you from taking advantage of the work and goodwill of others and giving nothing in return. Reneging on a payment or shirking a shared responsibility have no consequences if you'll never see the injured party again and state institutions like police forces haven't been invented yet. But if everyone did that, nascent large-scale societies would collapse. Economists call this paradox the free rider problem. How did the earliest large-scale societies overcome it?

Isn't this exactly what happened? Or to what "large-scale societies" are they referring? I studied Latin American and Spanish history the most, so I'll stick to the best example I know of.

In an infamous story of Spanish colonisation in modern day Cajamarca, Peru, and what would precipitate the Battle of Caxamarca and initiate a 2000-people massacre and the destruction of the Incan empire, Friar Vicente de Valverde y Alvarez de Toledo in a deceitfully kind manner asked Emperor Atahualpa to essentially convert to Catholicism. This was after Spanish conquistador Francisco Pizarro wanted a friendship pact that Atahualpa had already heard rumours was a trap. So, Atahualpa refused. Later Friar Vicente gives Atahualpa the Bible, which he knows indigenous peoples do not know what one is since they had not even discovered writing, much less books, at that time. Atahualpa naturally throws the book and this is taken to be an "attack" on the Spanish Empire.

The Spanish armada guns down 2000 natives, erects a church at the Incan capital of Cuzco, and proselytises the entire kingdom. Don't read the garbage Wikipedia article on it. Instead read Spanish Friar Bartolme de las Casas' A Short Account of the Destruction of the Indies.

Then juntas were formed. The Spanish empire was spread thin. Dutch Revolt. The Napoleonic Wars? British West Indian labour unrest?

These researchers should look up the word PROSELYTISM. They seem to have ignored the beginnings of the Christinisation of a large part of the world. It was tainted with killings, political deceit and motivation and to control societies, as was the case with Constantine

The article says:

In some societies, belief in a watchful, punishing god or gods could have been the key, Norenzayan believes. As he wrote in Big Gods, “Watched people are nice people.” Belief in karma—which Norenzayan calls “supernatural punishment in action”—could have had a similar psychological effect in the absence of actual gods, a proposition his colleagues are investigating in Asia.

The researchers conflate obedience with some type of moral "niceness". For example, Japanese society has been constructed to publicly humiliate you if you step out of order. And humiliation and losing face is the worst social burden for them. There is no way to scientifically define what is "nice" without involving at least some type of philosophical underpinning; e.g., utilitarianism, consquentialism, deontologism. And even then, the only thing that may be proven is good ethics, not necessarily morality.

The article:

All you need, he argues, is a sufficiently affluent society in which people can afford to prioritize long-term goals (like the afterlife) over short-term needs. Studying Eurasian societies between 500 B.C.E. and 300 B.C.E., Baumard recently found that moralizing religions were much more likely to emerge in societies where people had access to more than 20,000 kilocalories in total energy resources each day, from food, fuel, and draft animals, for example.

This is partly right. Add syncretism to the mix and you see that religion is far more than a "cognitive byproduct", but not because it helps our modern societies maintain order. Anthropologically, we understand that tribes and early civilisations used superstition, fables, and parables to explain morality and ethics. In my opinion, modern societies's idea of "right" and "wrong" is too complex to analyse as a whole. Advancements in philosophy, science, neuroscience, and a more connected world have probably all contributed to our idea of what is right or wrong. Some of these happened to be aligned with Christianity's or religion's view of what is right and wrong. Remember that the Bible was written by many men who philosophised about the nature of what is right and wrong and that the most advanced moral philosophy stops at the 18th century, with Immanuel Kant. After that it's just philosophy of science.