This isn't some law of physics. A corporation could decide that their ultimate goal is to improve society, the planet, employees’s lives, consumers’s lives, etc above pure profit. This would of course result in less profit.
They could. But if they commit to relinquishing control of their enterprise to outside VC investors (as practically all SV companies do; there's no such thing as a self-bootstrapped unicorn!) they won't.
If you want an example of a tech company that actually decided to prioritize public good, I'd present Kickstarter, which has specifically registered itself as a public benefit corporation.
They are admittedly a lot smaller, and I'm sure there were a lot of situational details that made it possible, but they did it.