I really think the book Always Coming Home by Ursula Le Guin is very good on this subject, they have a sort of metaphorical religion created themselves, with many of the good community building aspects on religion.
I personally think there is much good to learn from the ways of Buddhism and Daoism, both their core ideas and some of the practice.