They're only a moral hazard if the plan is permitted to make promises without requiring the promisee to deposit enough funds. And that can only happen for government employee pension plans; private employee pension plans are required by Federal law to follow strict accounting rules which keep the pension fully funded--at any point in time the future expected liabilities must be backed by deposited funds sufficient to cover the liabilities according to a moderately conservative rate of return (e.g. 5-6%).

Private pension plans can and have failed, but that's because corporations sometimes devise clever ways to drain funds. They usually have to do this quickly, though, so it often occurs during mergers and acquisitions where the CFO can shift funds and pay them out as dividends, stock buybacks, or bonuses. Then when the Feds come knocking on the door six months later the CFO moans and cries to the regulators and shareholders[1] about how their pension liabilities are a crippling burden, which is total B.S. because if they hadn't played games the pensions should represent a $0 liability at any point in time. Actually, because of the way the market works--long runs of above average returns followed by sharp below average returns--CFOs just as often claim that their pension funds represent idle money. Of course it's not idle, it's invested in the market, and while those funds are nominally controlled by the employer in reality they're an expenditure no different than the paycheck the cut their employees every other week.

Public pensions, however, aren't required to be fully funded. Politicians are happy to promise huge pensions to placate employee unions without giving a second thought to how they might actually fund those future liabilities today. (Notably, unlike state-government employee pension plans, Federal employee pension plans are kept fully funded as required by separate Federal law, notwithstanding the USPS, which has a complex, unique story of its own.)

A defined-benefit pension is basically just an annuity, and any economist will tell you that annuities are one of the most rational and efficient retirement devices around. The real retirement crisis that we'll see (and which we got a glimpse of during 2008-2010) is when people realize how risky and poorly funded their 401(k) plans are, especially during economic downturns. It's going to be epic particularly because most people only invest 4-5% of their wages into a 401(k) at best, whereas for somewhat historic reasons defined-benefit pension contributions usually represent 20-30% of compensation. Things are going to get nasty....

What we should be doing is incentivizing pension plans, not disincentivizing them. Pension plans should be the dominate retirement strategy. But because the potential for moral hazard is significant when governments make these promises (there's no higher authority to ensure promises are backed by commensurate present funding), we can't rely on government to do this directly. Social Security is very similar to a defined-benefit plan in the sense that there's a set formula for benefits based on wages, and it's a very important safety net we should strive to maintain. But it's just a safety net and we shouldn't expect anything more of it.

A great book explaining the history of pensions and the shift to 401(k)s is "Retirement Heist: How Companies Plunder and Profit from the Nest Eggs of American Workers", https://www.amazon.com/Retirement-Heist-Companies-Plunder-Am.... The author was an investigative journalist for the Wall Street Journal, and the book explains in interesting and somewhat technical detail the legal and financial machinations of defined-benefit (pension) and defined-contribution (401(k)) plans.

[1] Investors who conveniently forgot or had no interest in understanding where that windfall they received 6 months earlier came from.