That's not what he was doing. He was pointing out that stocks and the economy aren't the same thing. As in his example, if prices are too high at point X, then over the next 17 years prices can go down even if GDP is going up.
Buffett advises investing in SP500, because it does serve as a proxy for the economy. Assuming you think the US is going to be around in 10, 20, 30, 40 years in any formidable form, then surely the performance of its largest 500 businesses is some sort of proxy for the performance of its economy.
He advises investing in the SP500 because for people who don't know what they are doing he doesn't see a better alternative. And he's right.
And sure, it will almost certainly track the economy in some sense over decades, but it need not do that over 10-15 (or 17 in his example), and it isn't some law of physics type situation. The underlying factors that drive returns on capital through time (strong property rights, reasonable labor laws, stable government) also likely drive economic growth.
It's an expectations market.