Religious people are nicer to others, i.e. more charitable, because they think someone, i.e. God, is always watching them; surveillance makes be behave morally.
And in the god-fearing US, this is empirically true: religious Americans are nicer, i.e. more charitable—and happier—than their atheist counterparts.
But in godless Scandinavia, people in general are nicer to each other.
According to Paul Bloom, religion offers us
a. factual beliefs, such as the idea that there exists a single god that performs miracles, and
b. moral beliefs, like the conviction that abortion is murder.
c. There are religious practices, such as the sacrament or the lighting of Sabbath candles.
And there is
d. the sense of community that a religion brings with it—the people who are part of your church, synagogue, or mosque.
Perhaps the positive effect of religion in the real world is tied to this last component. Perhaps humans are social beings, and we are happier, and better, when connected to others.
The Scandinavians have a strong sense of community, whereas in America, community is reserved for the religious, that is, American atheists are often left out of community life by their religious counterparts, so are less happy.
So, religion might make you happier to be part of a community and, therefore, more generous to the other members of that community, but belonging to a religious group (or any other group, of course) can lead to indifference—or worse—toward those outside of that group.