Firstly, nobody is prosecuted for discrimination. Discrimination is not enforced by criminal law; it's enforced by civil ones. You are sued, not prosecuted, for violating them.
Please go back in time, and ask black Americans their view on the matter before such practices were outlawed. Ask some women how harmless it is to get paid less than men for the same job.
By no means are things hunky-dory today, but they are indisputably much better than they used to be. You certainly can't change attitudes through laws, but when attitudes keep people from wanting to do the right thing, laws certainly nudge them to do it anyway.
If you are an immigrant, you are going to choose a place because it's less-bad than the one you came from. That doesn't mean that they deserve to be taken advantage of simply because it's possible. I'm pretty sure that if those Indians in Dubai could find a job in say, Europe, doing the same work for the same pay, they'd certainly choose to go there.