Two main reasons: You get tax breaks, plus - in some cases - a bonus from the boss, known as a matching contribution.
First of all, money you deduct from your paycheck and invest in a 401(k) or other defined contribution plan is “pretax” money, meaning your contributions are taken from your paycheck before taxes are deducted. That means you lower the amount of income you have to pay taxes on, which can soften the blow to your take-home pay. For example, if you put $100 into your 401(k) each month, your paychecks might only get smaller by about $60-$80 per month. (The exact amount will vary depending on your salary and tax bracket.)
So if you make a small contribution to a 401(k), or if you increase your contribution by 1% or so a year, chances are you'll hardly even notice the difference in your pay checks, and your tax bill will be lower.
Second, as long as your money stays in the plan, you won't pay a penny in tax on your investment returns. All the money you invest compounds year after year without any tax bill from Uncle Sam - at least until you're ready to retire.
There's also a type of 401(k) plan called the Roth 401(k), which offers a tax break that essentially acts as the reverse of the traditional 401(k): You do have to pay tax on your contributions, but you won't have to pay any tax when you withdraw the money in retirement. So all the money in your account grows tax free.