Lets talk about real life for a bit:
Lets say in 2011 you had a good chuck of change, like 50,000 and wanted to put into one investment. You read the compelling articles from zero hedge calling for hyperinflation, and that gold wasn't a bubble, and invested all your money in gold at 1371 $/oz. Another person didn't buy into Zero Hedge's stupidity and parked all of their cash in a basic S&P 500 index fund ( it costs nothing and no research is necessary).
Fast forward to today. The world hasn't burned down, hyperinflation never occurred, and the dust has settled. You start to change your mind, you meet a special lady friend, and decide to buy a place. Time to cash out!
The gold bug His investment has dropped. His 50,000 $ is now worth 42,000 dollars. He can write off his losses.
Stock market dude His investment has appreciated to 79,000 dollars, less long term cap gains and its closer to 76,000$.
Stock market dude can put 50,000 into a nice house or condo, and still have a nice cushion to live off of. The world hasn't ended, he has money left over money, and a nicer house.
The problem with gold bugs is they always wait for the end of the world, and it never comes. In the meantime, while reveling in their self induced pessimism, they lose out on real things in life. Stock market dude now has a real house, and real money to support himself. Gold dude just lost his annual raise and has to work harder.
Some people might fire back and tell me I cherry picked my time frames. There are instances where you could look towards gold and find better returns there. But if you were to agglomerate all the long term returns from gold and the stock market, the later always wins.
Further, I don't feel gold would be a store of value in a doomsday senario. Water, heating oil, food, guns and business would again have more value than an arbitrary currency. If a municipality is starving or lacks clean drinking water, a gold bullion isn't going to solve that problem. A group of people who roll their sleeves up and makes **** happen will.
This is why I invest in the stock market.