Sure, at its basics, society has needs, known or unknown, good or bad so companies are created to fill the needs. Companies survive if they reach enough people with their solution.
Sure there are ways to manipulate needs but at its basics companies are supposed to benefit society by filling those needs.
We are fed the idea that companies are created to profit the investors but profits are a side effect of meeting needs.
More specifically, profits are a side effect of meeting sufficient numbers of individuals' needs. It does not necessarily follow that meeting the needs of those individuals benefits society at large.
Profits are also a side effect of meeting needs today. It does not necessarily follow that meeting needs today benefits society in a meaningful way in the longer term.
For what it's worth, I think your implication is true. Clearly most companies create wealth and deliver benefit to society, it's that aggregate effect that makes capitalism the most successful system we know of under which to run a society.
But the reality is that it's entirely the other way around: companies do exist to profit their investors and it's the benefit to society that's the (usual, aggregate) side effect. It's not good, or bad, it's just a fact.
It's trivially true. A worker produces something and gets a fraction of their value paid back to them. They would not have been hired if it were not so.
Sure there are ways to manipulate needs but at its basics companies are supposed to benefit society by filling those needs.
We are fed the idea that companies are created to profit the investors but profits are a side effect of meeting needs.