The "Gospel of Wealth' was meant to be invested into charities and be an 'example to the poor'
serving as orphanages for abandoned children.
They thought gods had effect on everything - good harvest, disastrous floods, health, wealth. So, whoever they believed was close to the gods, such as priests, was in the upper class.