Before we answer this question, let’s first understand how Hinduism literature is structured. Hinduism literature is divide in groups, where Shrutis, which include Vedas, Upanishads, are authoritative texts, which are binding as it is. Smritis and Shastras are written by people for a purpose, which don’t need to be always religious. For example, assume that a king decides to make new rules for his subjects; he can do so by creating his own shastras, so that people can follow.
In short, shastras, smrutis are not always religious in nature, these are written by some king or Acharya, as was thought by them, as being best rules to follow. It was very common to have multiple Dharma Shastas active at the same time, in two different kingdoms. Additionally, these documents are expected to be revised or changed with the changing times.
Coming back to Manava-Dharmashstra (aka Manusmriti), it starts with it’s own version of how world was created and then goes on listing rules for various actors in the society. This does not provide any linkage to Shrutis, or any reference to how these laws are derived, these are just statements, without any religious backing.
We actually don’t know who and why it was made, and it was a long forgotten, until it was given prominence by Britishers. Britishers, once got hold of it, made it a primary document to base laws on, as they wanted to “divide-and-rule” this country. Please note, there is no proof that any major/minor dynasties from ancient to medieval times ever used Manusmriti, to make laws or for anything else, before Britishers. It was a minor shastra, long forgotten, which no-one cared.
Additionally, If Manava-Dharmashstra, would have been indeed such a prominent piece of religious literature, as claimed by Britishers, we would have seen commentary written by Adi Shankra or other religious scholar on it, but that dose not exists. So Manava-Dharmashstra (aka Manusmruti) is not a religious in nature, and has no backing from Shrutis, and not any important piece of dharma literatures too. It was Britishers who started to use this and created a society which is NOT based on Hinduism’s core principles.
It’s an irony that Hindus themselves started believing on what Britishers taught, and started to think that they are required to follow the caste system, and started to act on it.
By the way, Indian society based on Hinduism always had division of society based on work (called ‘Varna’), without discrimination and with ample opportunities for people to change their work as needed. More about it at: Varna System
In short, Even though there is no basis for caste system and associated discrimination in Hinduism, and it has been more than 70 years Britishers have left India, we still see these issues cropping up in India everywhere. Britishers were extremely successful in planting the seed of social divide and the political system after them found it useful so continued with that.
Having said that, things have improved quite a lot over last century, thanks to effort of various social reformers like Mahatma Gandhi, Dr, Babasaheb Amdedkar, Jyotiba Phule and many others. But we haven’t completely got rid of it and there is still a lot of work needed.