A new study suggests religion can prompt people to be generous to outsiders, even those from groups they distrust.