that's just not true and is a gross over simplification. for one, not beating the market is NOOOOOT the same as losing money. For another, even if they do not beat the market, there are a lot of other benefits.
People gain an understanding of how things like bonds and equities work. I cant tell you how many people (masters degree included) think you can loose more money than you invest by buying a stock. I seen someone literally not participate in 401k matching because of that thought.
there is something to be said about having greater control over one's money. When someone says lets eat out at this expensive 150$ plate restaurant, I think gee I can buy X shares of Y stock instead.
I personally have already maxed out my 401k, and if I want to retire I need to contribute more. currently I am beating the market, and I have little care if 'the average investor' isn't. it gives me something to do, empowers me, and is not 'at best' gambling.
I personally invest primarily in well diversified, extremely low cost ETFs and I buy 1 - 2 positions a year outside of that portfolio (right now the main one is bitcoin for me). But, I'm always looking around for something that I think can be a 10X return.
But... I rely on my primary diversified portfolio for my retirement and the single 1 or 2 investments I make outside of that are for fun, knowledge and I fully acknowledge gambling.
Nothing wrong with being investment savvy and all that jazz but obsessing over it doesn't sound healthy.
People can enjoy a fancy plate or 2.