The tech industry saved many lives during this pandemic. Compliance with social distancing standards would be way lower if people had nothing to do at home but watch TV. Even social media is showing its bright side. People are using it in more positive ways, connecting with each other and largely sharing quality information regarding Coronavirus. Life would have come to a halt without modern internet technology, almost warranting a calendar pause until the pandemic passes.
That being said, there's a lot of variability in the social value of tech industry jobs. At risk of being pedantic - you can net society more social good if you transition to a higher social value job within the same industry. It takes many years to become a doctor, and many people compete for that career so you wouldn't expand the supply of medical labor. Moreover, medical industry cronyism plays a part in bankrupting America with little to show for it. You should do what you want ultimately. I've just seen some people self-flagellate when they're actually doing really good things for society.
And outside of that (i.e. big tech) there's plenty to invent and contribute in countless ways. Medical equipment, niche technology products, innovative and useful consumer technologies, the warriors we don't hear about improving industrial processes and everyday stuff, etc.
I have younger friends looking to enter the game industry. I tell them: make sure you don't land somewhere that makes you start hating what you loved just so you can tell yourself you make games (having addiction-machine mobile games in mind). Better work anywhere else and wait for the opportunity to do it right, I believe.
Selling your soul is always a choice... and it's not an easily replaceable good.
By all means pursue things elsewhere, but not because you think there are no opportunities in tech.
Personally, I believe I can do far more good writing and pushing public policy than any amount of code. That is "operating at scale".
With that said, here is my example: Medicare For All would save us $450 billion, and avoid 68k preventable deaths, every single year. I find it a stretch to suggest that ambitious goals such as that "lack imagination". Such impact is simply not obtainable with tech or NGOs alone. Even Bill Gates has needed roughly $50 billion to drive forward his foundation's humanitarian efforts (but admittedly, is very efficient, with estimates of having saved ~122 million lives through their work).
To stay with your examples, some of the Gate's foundation efforts have largely been tech efforts, some haven't. Some of the things I mentioned off-the-top have potential to reach 10s to 100s of millions of people. MFA is a big $ number partially because the US healthcare system is expensive and inefficient, so that draws focus on $ saved ... other efforts may focus on lives impacted at much lower $ impacts.
Most public policy work isn't as big as MFA either.
I'm not saying policy work isn't important or impactful. I'm rejecting the idea that you (generic 'you') can't have similar effect in technology to what you might be able to achieve in policy; especially the idea that this is so clearly true that the "right" thing to do is quit technology to go into policy. Even assuming you can be as effective in policy work as you are in tech work, which isn't a given.
I doubt anything at all comes close in leverage. Maybe having mountains of money or being POTUS.
How do you think a doctor feels when he sees some fat patient going into the donut shop (or all you can eat buffet) after he told them to go on a diet and lose weight. (is this worse than the person who dies of bad genes caused heart attack despite talking their medications, exercising and eating well - another thing doctors see)