You're forgetting the obvious: investing is risky. No investment is guaranteed to give a positive return. In a perfect market, the price of an investment is equal to the expected return multiplied by the expected probability that it will actually deliver that return. Companies (and individuals) will invest if they believe (possibly with good reason) that a particular investment is less risky (or would give a greater return) than what the rest of the market believes.
Take Bitcoin for example. I, personally, believe Bitcoin is grossly undervalued. It has the low value that it has because most of the market believes that it is very risky, and unlikely to generate good returns. I, on the other hand, do not think it's as risky as people say it is, and that it has the potential to generate fantastic returns. So I invest in it. All other investments are bought for ultimately the same reason.