The idea of human rights rests on the central premise that all humans are equal. It follows that all humans should be treated as equal, and all humans have dignity. Anything that undermines that dignity is a violation, for it violates the principle of equality, and it paves the way for discrimination.
Human rights law does allow for some discrimination – in particular, actions undertaken to protect the marginalized and the vulnerable, and to extend opportunities to groups or individuals who have historically faced discrimination.
While discrimination has not been eliminated entirely, progressively, international law has extended the reach of human rights, and countries have legislated against discrimination, and criminalised it, and barriers imposed by gender, caste, religion, race, language, have slowly fallen.