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.