India was ruled only for a very brief period by Hindu kings.
From 300BC to 1000 AD, India was under the rule of Buddhist and Jain Kings (mostly, with exceptions like Guptas). Then we had 1000 years of Muslim rule and british rule.
So it is clear that the problem is not with Hinduism but with Indian Society and more importantly the middle castes (read as rich OBCs) who are the biggest beneficiaries of the caste system