A religious basis for ranking people would affect the social classes in question by making it impossible for people who belong to a religion that is considered "inferior" to rise up in society, while make those who belong to a praised religion the elite.