Actually, yes. A community of religious people [not necessarily stupid] is more tight-knit against a community with no common belief. In the days of bands, tribes, and city-states, this could be a large advantage. Just label the next neighbouring tribe as 'Godless heathens' and see your fellow tribesmen raise hell on them...