The problem is that for a normal country, coding isn't such an attractive career in general. It makes about the same money as every other engineering field (and less than many, like architectural engineering) requiring similar qualifications, and in many ways more exhaustive/painful, so only reason why you may want to be a coder in say UK is to love coding, then your hobby becomes your job. Hiring a British developer, you may be more or less certain you aren't working with a cynical milkman.
In poor countries, coding is usually the only way out of extreme poverty, unless you are born into right family. What other good careers are available in India that beat freelance coding at average ($30/h) rates? So, it attracts people who are simply after money and nothing else, they practice squeezing their clients dry and doing all kinds of tricks more than they practice coding. Because they give no shit about coding.
Are you sure about the 30$/hr figure for people escaping extreme poverty?
30$/hr is rich in India, so it's not surprising there aren't better rates.
30$×8×20×65 = 3.2 lakhs per month = 37 lakhs per annum (average Indian makes somewhere of the order of magnitude of 1 lakh per annum).
For reference, in /r/india (on Reddit--not representative of the average Indian) a person posted about how they were struggling to live with 1.6 lakhs per month, and that became a meme.
This is exactly my point. Programmer in a developed country makes about 3x the average salary and about 1-1.5x the average salary of someone having a college degree. Programmer in India makes 37x average salaries. So, in a developed country you don't go into development after money (or if you do, you start your own startups, because you are definitely not going to get rich coding for cash). In India, you go exactly after money and nothing else, because the scale of money you get eclipse everything else. If i was able to get 37x the average salary, moral barriers in my work will seem a lot lower to me.
In poor countries, coding is usually the only way out of extreme poverty, unless you are born into right family. What other good careers are available in India that beat freelance coding at average ($30/h) rates? So, it attracts people who are simply after money and nothing else, they practice squeezing their clients dry and doing all kinds of tricks more than they practice coding. Because they give no shit about coding.