Being FROM India is a good reason to work in India. Do you think uprooting your life is a piece of cake? What if you have old parents? What if you prefer your own culture and not being an immigrant for the rest of your life?
Also, you're overlooking how much a good software engineer makes in India (adjusted for cost of living). It's probably somewhere in the top 1% of Indian earners. That's living in a mansion with servants kinda rich. In Canada a software engineer, even working for Meta, is still middle to upper middle class. Some of them probably can't afford a home without taking a huge debt. They will live comfortably but won't be rich in relative terms.
I'm an immigrant in a non-English speaking country, I'm well aware of how difficult it is to uproot, and I can tell you that what I'm doing (on the surface) is much harder than going from India to North America.
> That's living in a mansion with servants kinda rich.
That doesn't counter the problems with the infrastructure. If you stay in your mansion then I'm sure it's great but go outside…
Funnily enough, I used to wonder if I could set myself up in India with a VOIP number with a London area code, so I've considered it. But now I'm older and wiser and I'd choose Canada too (just).