They did that for economic reasons (to gain more business from the U.S. and European nations), not because of their religion. Prior to India's drive for economic growth, people of the lower caste were treated worse than stray animals.
india was a socialist country and had a closed economy. their affirmative action had little to do with "investments from the US and europe". india opened up her economy in the 90s and their affirmative action program was in place since 1947 when she got her independence from britain.
in comparison the civil rights movement didnt take off till the 60s and 70s here. if i remember right people of a certain color couldnt vote deep down south. that is a far cry from the south that we see today.
in contrast ISLAMIC nations like pakistan treat non-muslims as half human beings and this is the LAW OF THE LAND. if you are a non-muslim woman you are a quarter human being. i wont even bother about saudi arabia.