For Wachovia (NYSE:WB) shareholders, it may have seemed too good to be true. But it wasn't.

Just days after it essentially collapsed and Citigroup (NYSE:C) made an offer to buy its banking assets for $1 per share, Wells Fargo (NYSE:WFC) came out of nowhere, offering to buy the entire company for $7 per share with no help from the government. No backstop from the FDIC. No taxpayer intervention. Nothing. Just a good ol' fashioned buyout.

But why?

Why was Wells Fargo so eager to ante up a deal that was leaps and bounds sweeter than Citi was willing to pay? After all, Wells Fargo has a stellar reputation of keeping underwriting standards in check, so why would it want anything to do with a shoddy bank drowning in subprime mortgages?

Taxes. It was all about the taxes.

The day after Citigroup made its bid, the Treasury changed a tax rule that lets banks accelerate the losses and writedowns on banks they acquire against their own net income, offsetting the charges as tax write-offs.

Wells plans on writing off some $74 billion of Wachovia's $498 billion loan portfolio -- an insanely large amount that reflects just how poisoned Wachovia's books really were. With the new tax rules, it gets to use all of that $74 billion as a charge against its own net income, which means one thing: Wells Fargo's going to be a tax-write-off machine for years to come.

Just how much will it save? The Wall Street Journal, citing an independent tax analyst, estimates Wells Fargo could reap a tax savings of about $19.4 billion. To put that in perspective, the 0.1991 shares of its own stock Wells Fargo is offering Wachovia comes out to around $6.24 per share, or roughly $13.8 billion. Yes, Wells Fargo gets a $19.4 billion tax break for a company it'll pay just under $14 billion for (if the deal closed today).

In other words, Wells Fargo didn't pay anything for Wachovia: The IRS paid it more than $5 billion to take it. Who ever said you have to fear the taxman?

A couple implications of this: One, it's a good thing that at least some benefits are granted to companies willing to buy failed banks. After all, had Wells Fargo not stepped up to the plate, the existing deal with Citigroup could have stuck taxpayers with tens of billions of dollars in losses.

Nonetheless, let's keep in mind what these tax advantages are: yet another page in the bailout book. You might as well add these tax breaks as a stealth entry to the nearly $3.9 trillion or so already laid out to right the banking industry.

When will it ever end?

For Related Foolishness: