The capitalist response to that would be that the investment in companies is better because it makes everyone richer in the long term by increasing overall wealth.
I'm not sure I buy it but it's an effect to consider.
That does sometimes happen - investment does cause development. The mistake is to assume that's always what happens, and that everybody can benefit from the development.