This is true for people who are buying as speculative investors and focused on short term movements in stock price.
However, that's not everyone by a longshot. There are plenty of people who buy for underlying asset value and dividends.
See, for instance -
http://en.wikipedia.org/wiki/Intelligent_Investor
Warren Buffet has said that The Intelligent Investor is the best book on investing ever written.
A fundamental tenet of value investing is that you're buying a small part of a business, not something separate from the business. Keynes is talking about buying stocks to speculative on short term price movements, which is risky and probably a bad strategy for the vast majority of people. But buying a share of a business that's fundamentally solid and priced attractively is rational, even if the business isn't currently popular.