Not everyone agrees with that law. In fact there are massive protests against it with dozens dead.
Its good to understand history. India and Pakistan were partitioned based on Religion. Muslims under Jinnah decided that Muslims cannot live in a united country and partitioned United India. Millions were killed during that transition in 1947. Same with Bangladesh in 1906. Things were settled long time back once and partition is a one-time affair. Is it not?
> when the Indians just happily passed a law against Muslim immigration
That's because of the current Fascists govt who is hell bent on copying 1984, China & Nazis.
Most Indians do not support this law.
Letting poor muslims compete with you on fair terms does not increase inequality. It undermines your position of power.