Immorality is much easier to excuse when you believe there is a divine order to things. When someone is poor, or suffering or has had a bad run of luck, belief in a divine plan makes it easy to see that as deserved, instead of unfortunate. When someone is rich, powerful and/or fortunate, you're more likely to see them as superior and deserving of their good fortune if you are religious.
Every time you hear someone thank god that for answering their prayers and blessing them with something, keep in mind that intrinsically behind that statement is the idea that god has made a judgement call and found them deserving of having their prayers answered. It's a round about way of saying "God chose this for me, because he thinks I deserve it." It always rubs me as subtly arrogant to imply that whatever good fortune you are enjoying isn't simply good fortune, but it's a reward you earned because god found you deserving of it, and thusly found everyone else who doesn't receive that same thing, undeserving.