Source: Moodboard Photography via Flickr.

Social Security pays benefits to nearly 60 million people, and the vast majority of those recipients are workers who claim Social Security in retirement. Yet more than 2.3 million of those who are on Social Security get benefits as the spouse of an eligible worker, and with spouses eligible to receive as much as 50% of the worker's primary benefit, those payments can make a huge difference in terms of total family income.

Most people understand that claiming early benefits from Social Security results in smaller payouts, and many think that taking a small cut is more than worth it to get early access to monthly income. But for spouses who had income of their own during their careers, electing to take Social Security before reaching full retirement age comes with a much bigger penalty -- one that could cost you tens of thousands of dollars over your lifetime. Below, you'll learn how to avoid making that mistake, but first, let's take a look at why this punishing provision is in Social Security in the first place.

Spousal benefits and the deemed-filing rule
The way spousal benefits work seems pretty simple. If you take the retirement benefit that a worker is entitled to receive at full retirement age, then the spouse can get half that amount. In the same way that regular retirement benefits get reduced if you take them before full retirement age, spousal benefits also get smaller if the spouse takes them early. To that extent, the spousal rules are consistent with the worker rules and seem fair.

Yet hidden within Social Security's rules is what retirement planners call the deemed-filing provision. What this rule says is that, if you claim spousal benefits early, you are automatically deemed to have claimed any retirement benefits under your own work history at the same time.

This situation confuses many people because of a misunderstanding of how spousal benefits work with your own retirement benefit. If the benefit based on your work history is greater than your spousal benefit, then you simply get the higher retirement amount, with your spousal claim offering no additional money. If the spousal benefit is greater, then you first get your own retirement benefit, and then the Social Security Administration adds money to your check until it matches the higher spousal amount.

Even though that might sounds like the best of both worlds, it's not. The reason is that if you wait until full retirement age, you can restrict your application to just take your spousal benefits, leaving any benefits on your own work history alone. That allows your own retirement benefit to receive delayed retirement credits, letting you switch later in life and getting an even higher payout.

How much money are we talking about?
Consider an example in which you're 65. You'd be entitled to receive $500 a month under your own work history if you waited until full retirement age a year from now, and your spouse just claimed at full retirement age and gets $1,000 a month.

If you file for spousal benefits now, your spousal benefit would be half of $1,000 or $500, reduced by $42 to reflect your having claimed a year early, or $458. Your own retirement benefit would be $500, reduced by $33 using the different early claiming formula for primary workers, or $467. As a result, you'd get $467 per month, the higher of the two.

If you wait until age 66, though, you'd be eligible to file for spousal benefits only, letting your own retirement benefit increase. You'd get $500 per month in spousal benefits, with four years of payments that are $33 larger partially making up for the year of payments you gave up by waiting.

The true advantage, though, comes at age 70. At that point, you can claim your own benefits and receive delayed retirement credits that will boost your benefit by 32%. As a result, you'll get a nice boost all the way to $660 per month. That extra $193 will add up to more than $23,000 extra from Social Security over the course of a decade, and that doesn't even take you to the life expectancy for those turning 65.

It might not seem fair for Social Security to punish spouses who claim early in this way, but until Social Security reform becomes reality, your best course of action is simply to avoid the deemed-filing rule when it would hurt you and instead take advantage of the added incentive to wait until full retirement age. Doing so could put a lot more money in your pocket over the long run.