Both can be true.
- Investing provides benefits for society at large - Investors are exploiting the labour of others for their own gain
(but also your examples only work in a very weird worldview where everything is privatised, but I don't want to bother discussing that on this website)