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.