The occasional donation to a non-profit might help people subsist, but it doesn't build a better society with more opportunities for everyone.
Nobody needs an obscene salary for writing code when others are struggling to afford the basics.
As an aside, I remember being really taken aback when I went on holiday to the US and most of the menial jobs were being carried out by Hispanic and Black people. I guess if you are a white American you get inured to it, but as a white European it was kind of creepy and a bit repulsive.