Personally, I think the idea that Google/Facebook are hurting people by paying talented engineers a lot to work on ads is just not true. I think that if you act ethically (which is admittedly a question mark sometimes for any big corporation) respecting the market can often do the most social good.
People who were doing silly work making video games pushed the boundaries of parallel processing, created the GPU industry, and now that is relied on for serious scientific research. People making social networks so college freshman could date made tools to help those fighting authoritarian governments connect and created infrastructure technology to work on big data problems the governments might face on social issues.
Who did more to help the Asian Tigers raise from poverty to economic superpowers? Peace Corps people distorting local economies with their help, or people investing in local infrastructure because it was good value for them to make money??
What's better for the world, besides your conscious, working for a soup kitchen for work that can be done for $10/hr, or freelancing for $50/hr and donating that to the soup kitchen to give someone with less skills a job and the soup kitchen $40 remaining to buy supplies they need?
Finally, a lot of really smart people end up going in to law or finance because that's where the money is. Even if making consumer ad-tech doesn't sound quiet as noble as researching novel energy, if it encourages people to start entering fields where they are building things rather than creating more regulation for things, it's probably a net-positive. I really doubt that this idea that engineers should be this monastic underclass is so great for society. I constantly hear programmer say their salary is "inflated", to which I respond "if you feel overpaid, give your money to a good charity, don't roll over for the uber rich tech-exec/VC in charge."
If you want to make a positive impact on the world, respecting market efficiency is underrated.