I have this feature in The Tablet this week.

Fundamentalism, fanaticism, fights. Headlines in the press often cast religion in a bad light. In fact, the evidence suggests otherwise; all in all, the practices of faith tend to have positive effects on people’s lives.

The impact has been assessed across a number of metrics. For example, the likelihood that an individual will drink excessively or take drugs decreases significantly if they go to church, temple or mosque. Among Americans – where religiosity has been extensively studied – being actively religious means you are less likely to commit crime, get divorced, commit suicide or suffer from depression. You will probably also be healthier and live longer.

The upbeat message sounds clearly in posi­tive psychology too, the discipline known as the science of happiness. Martin Seligman, the US psychologist who has put positive psychology on the map, argues that lasting levels of happiness can be influenced by changing your life. “Becoming religious” is in his top five things to do. These results are echoed by the economist, Professor Richard Layard, who advised the last Labour Government on well-being. In his 2005 book, Happiness: lessons from a new science, he presented evidence that having no faith had a more detrimental impact on happiness than losing a job, though not quite as bad as being widowed.

It reads as if the science was designed for advertising God. But the evidence becomes more complicated when a further, crucial question is asked. Just why is it that religion has positive effects? A range of possibilities are mooted, and hotly contested.

A first possibility assigns efficacy to the proscriptive character of religion. World faiths carry moral weight, which is to say that they encourage, if not insist, that faithful adherents do not do things like take drugs, commit crimes and practice infidelity.It is certainly the case that commandments, in the form of “thou shalt not”, are important. They set a tone, help sustain attitudes. But, as any honest believer will testify, commandments are often honoured in the breach. So the question needs to be asked: how it is that proscriptions ­actually work, in so far as they do?

The story of the founding of Alcoholics Anonymous is illuminating. In 1931, the psychologist Carl Jung was trying to treat an alcoholic, though Roland H’s craving for drink remained stubbornly strong. Then Jung had an idea. He recommended that Roland attend the meetings of an evangelical Christian movement which stressed submission to God. It worked. Roland had a conversion experience, which Jung interpreted as releasing a new source of energy from his patient’s unconscious, one more powerful than the desire to drink. Roland related the experience to another apparently hopeless alcoholic, Bill W, and it worked for him too. He founded AA, which today has more than two million members in 150 countries.

Research on the effectiveness of the 12-step AA programme is disputed. But it seems undeniable that the recognition of a “higher power” was crucial to the success it has had. In other words, proscriptions work not when they are perceived as persecutory commandments but rather when they are perceived as charting a path to a new way of life.

Speaking personally, I have a friend who regularly attends AA meetings, though he is not a churchgoer. But the language of conversion makes eminent sense to him. He pointed me to the literature of Narcotics Anonymous, which expresses it well. “For our group purpose there is but one ultimate authority: a loving God as he may express himself in our group conscience.” And yet, this only points to another knotty issue in the debate. It has to do with the significance of groups.

An alternative possibility to prohibitions being the secret of religion’s success is that individual well-being is boosted by the social support provided in groups – and not just religious groups, but family groups, common interest groups or therapeutic groups. Could the group aspect be what helps people at AA meetings and benefits people who go to church? As the psychologist Oliver James recently noted in The Guardian: “It is … plausible that the comradeship and feeling of belonging supplied by religious peers are a substitute for the buzz you get from substances.” James conceded, however, that social support does not provide an adequate explan­ation. He cited a large-scale study that tracked the lives of thousands of Americans and concluded that community was not a substantial mediator of inner strength.

There are other possibilities. Richard Layard has suggested that the benefits of religion have little to do with prohibitions or sociality but, rather, the issue is emotional habits. He argues that religious practices train individuals to control their feelings.

In his book on happiness, Professor Layard discussed The Spiritual Exercises of Ignatius of Loyola, noting how the saint sought to nurture several attitudes that modern science has demonstrated are essential for well-being. Ignatius urged his readers to praise God, that is, to learn to be grateful. He believed that humankind was made to serve God, which had the effect of dissolving egoism by drawing attention away from yourself. As Layard also pointed out, Ignatius argued that salvation involves being indifferent to what happens to you, so while everyone has times of desolation, it is also the case that such experiences tend to pass. This too can help, by building resilience.

Resilience is a theme that interests Eric Greitens, an American humanitarian and social entrepreneur currently researching the virtue. Early indications of his work suggest that individuals who demonstrate resilience in the face of life’s difficulties cannot simply bounce back because their harsh experiences become part of them. Instead, they are able to live with the distress in such a way that they can ascribe meaning to it. The experiences do not demean them, but deepen their sense of being human.

Again, this is an attitude embedded in spiritual traditions. Julian of Norwich lived through the Black Death, one of the most devastating plagues in history, and yet she was still able to write, “All shall be well and all shall be well and all manner of thing shall be well.”

Many of the researchers in the positive psychology field are searching for ways of reformulating such religious attitudes for a secular age. They exhibit a desire to raid religious traditions for their wisdom, while removing the theological scaffolding that has traditionally supported them. One of the most articulate recent attempts is found in the latest book by philosopher Alain de Botton, Religion for Atheists, published earlier this year. In it, he agrees with the positive psychologists that religious practices provide useful techniques for everything from building humane communities to tending attitudes of kindness.

But reading de Botton’s book crystallised in my mind something crucial about religion that is overlooked. It will come as no surprise to believers that this something has to do with God. Positive psychology is characterised by its instrumentality. Alain de Botton puts it explicitly: “Religions are intermittently too useful, effective and intelligent to be abandoned to the religious alone.” What he misses, is that religions are good at building community and nurturing kindness because, paradoxically, they do not aim directly to do either. Rather, they aim to open adherents to that source of life, or spiritual sustenance, that is expansive of our humanity. They offer practices that, over time, transform the soul. It is variously called salvation, eternal life or enlightenment.

Goodwill and well-being may follow. They also may not. But when they do, they are happy by-products of the main task, which is not actually to have a successful life. It is to come to know God. The spiritual dimension has instrumental effects; but without the vertical striving, religious virtues come to feel empty. To whom are you expressing gratitude for life if not God? The blind mechanisms of evolution? Or, it might be noted that you do not become religious in order to be happy, and if you tried to do so the strategy would fail you.

It is striking that atheistic writers and researchers are coming to a new appreciation of religion. Going are the days when faith could simply be written off. Nonetheless, I suspect that their ideas will flounder because a basic and obvious question is being avoided, though as Oliver James remarked, it is one “no researchers have ever posited”. Might human well-being actually have something to do with God?