When talking about Hinduism and Hindu beliefs, people often mention the caste system, and often associate and lump the caste system in with Hinduism, as though it was actually religiously mandated. In reality, this is far from the truth.
The Indian caste system is actually a social idea, mandated by Indian society, not religion. It was never sanctioned by Hindu texts, despite what some in the West may believe. While Hindu texts do mention a system of social stratification that divides people based on class, work, and other things, it is merely described, not advocated or mandated. Some even think the caste system is an invention of the British colonialists, but this is debatable, and some question the idea as little more than revisionist history.
Not only is the caste system a societal creation rather than divine or religious mandate, and not associated with Hinduism, it’s also not even unique to India to begin with. Lots of societies had social stratification back then, and sadly still do today. In the Indian subcontinent alone, the idea of a caste system is also practiced by small groups of Christians, Muslims, and Buddhists, though keep in mind I do mean small groups.
The idea of caste being religiously or spiritually mandated probably comes from a major misunderstanding on the part of Westerners, particularly those who have confused social mandates with religious ideas.