Pensions are funded by the next generation, just like Social Security and Welfare.
You pay for the previous generation in exchange for the next generation paying for you.
Without this kind of offset, you end up with as much as 10-15% of your population as indigent elderly, homeless and starving, who become MAJOR financial burdens on their children (and I mean MAJOR -- ask someone from China or a similar country about it) or who become homeless or die.
It's unfeasible to set aside the money all at once, and in fact hoovering that much money out of the economy and into investments would have a noticable effect on the economy. You're basically suggesting something outrageous like 5% of GDP stop being transfer payments to poor people who spend it immediately and start being investments into government treasuries and corporate bonds.