Carol Graham's book Happiness Around the World: The Paradox of Happy Peasants and Miserable Millionaires is full of "paradoxes"... about those peasants and millionaires, more later. One of the most head-scratching is about religiosity. In a study of 90,000 people across 26 European countries, Andrew Clark and Orsolya Lelkes found that "to belong to a religion is positively correlated with life satisfaction." You can see how that might be. Belonging increases the chances of believing. And believing increases optimism ("God will provide, protect, prevent, etc."), which is strongly correlated with greater happiness.
Now here's the surprising part. Everyone is more satisfied with life in areas that are more religious, including the atheists. And everyone is less satisfied in places with more atheists. "Having a higher proportion of atheists has a negative spillover effect for the religious and for atheists alike." Apparently, to some considerable extent, our attitudes about life are held collectively. We don't individualistically base our outlook simply on the beliefs lodged within our own skulls.
The moral of the story is...what? Stay away from atheists? Send your kids to Sunday School, whether you believe or not? There are puzzles like this throughout the book. If we thought maximizing happiness was the prime directive, the book would lead to many very counter-intuitive choices and policy recommendations.