We learn hierarchies in many ways, including religion. Particularly in hierarchical religions, there are "in" groups and "out" groups, and people not in one's religion do not deserve what those in one's religion deserve.
It is not surprise then, that research is showing that children from religious households are actually less generous than kids from a secular background.
"It’s sometimes claimed that secular families are dysfunctional and rudderless because they
lack the security of religion. But sociologist Vern Bengston, who has
run California’s Longitudinal Study of Generations since 1971, says this
isn’t true: “Many nonreligious parents were more coherent and
passionate about their ethical principles than some of the ‘religious’
parents … The vast majority appeared to live goal-filled lives
characterized by moral direction and sense of life having a purpose.”"
http://www.forbes.com/sites/jvchamary/2015/11/05/religion-morality/