The issue I take with this question is that it’s not really possible to control a society. Society is comprised of people and what they want will forever be fully outside your control. The problem religion solves for groups of people is rather legibility.
When a thing is legible, that means that the mind can run over it and come to a basic understanding of how it works. You understand people by understanding what motivates them. At a small scale, you can understand one person or a small group like a family by watching them for awhile. At a larger one, you can look to the political news cycle and what it’s focusing on. You can even catch whiffs of actual efforts to control people by looking deeply at how that cycle works.
A system allows you to relax and engage in strategy rather than tactics. There is deep strategy behind Trump’s rise to power. His tweets are carefully picked to get people to focus on his agenda. No one tweet or gaffe can sink him because he’s continuing and honing and refining a skill he’s been engaging in for decades.
We have capitalism and market economies and that provides a great deal of legibility to society. You want to know what’s motivating a person, look at their financial situation. With money, you can buy pretty much anything, and so anytime people do things you don’t understand, you can pretty much boil it down to one of two things; either they need more money, or what they want, they can’t buy with money, such as romance or happiness.
Before ordinary people had money, a way to get what they wanted was to band together with their fellow villagers and go take it by force. This is, well, inconvenient. At the very least, it requires you to keep an army around to stop all this nasty mob business. Mobs require leaders, and leaders can come from anywhere.
Religion is, essentially, storytelling writ large. When you tell someone a story, you’re making a statement about underlying human motivation. When lots of people all like the same story, tell it to each other, and add to it in their own way, that story assumes a larger meaning. People look deep into them to find answers, and there’s no limit to how deep they will look, as phenomenon like The Da Vinci Code illustrates.
Stories become myth, myth becomes culture, and the underlying lessons about human motivation that the mythic stories provide form the aforementioned legibility that religion starts to codify.
People are always going to tell and share stories with each other. Some of those stories are going to be good and insightful and shareable. Those stories form the basis for the culture of the group. And the values derive from that culture, and so any group that hangs out together will start to cultivate the building blocks of religion.
This starts dovetailing with the motivation of people to succeed and thrive. Would-be leaders see the motivating features and learn to take advantage. Not everybody wants to work really hard to succeed. They’re happy to be left alone and want to be safe. But they like the stories too and so want to see them guarded.
Religion has historically been when everyone gets on the same page about the deep questions of what provides motivation in life. Nowadays modernity has broken the community bonds that held the whole thing together, so nobody really understands or has experiential knowledge of how it’s really supposed to work. Even in the fifties, modernity was assaulting religious society.
I don’t want to go back to those days, but I think it’s useful and worthwhile to try to understand it rather than just have this knee-jerk reaction against religion. 70 years ago, if you were an atheist, you still went to church. Not because you were forced to but because they were community hubs. Even if you didn’t believe, you could still communicate with just about anybody on the basis of the shared culture. Today we no longer have community hubs or universally-shared culture and everybody has to find some kind of angle to get people to spend time with each other.
Nowadays, the biggest thing that brings people together appears to be politics. Which is sad but also a little scary. Historically when the masses start paying attention to politics, revolutions happen. And those are not pretty.