How Morality Impacts Religious Beliefs