Over the past several weeks, there have been many headlines about the massive settlements involving the major U.S. banks. The narratives range from JPMorgan Chase (JPM 0.49%) agreeing to a $13 billion settlement over bad mortgages to Bank of America's (BAC -0.13%) proposed $8.5 billion agreement with private investors. 

However, don't let these headlines that are written primarily for their shock value influence your investment decisions. The majority of the fallout from the mortgage crisis is already accounted for in these companies, and any weakness based on the finalization of settlements should be viewed as a buying opportunity for a long-term, Foolish investor.

What the settlements actually mean for JPMorgan and B of A
The most notable of the mortgage settlements because of its highest-dollar value is JPMorgan's $13 billion settlement with the government mainly over charges that the bank overstated the quality of mortgages it had sold to investors. 

The first reason the settlement isn't as bad as it seems is that the $13 billion figure actually represents several settlements, not just one. $4 billion goes to FHFA, $4 billion goes to a "consumer relief package," and $5 billion is a civil penalty. In total, the settlement will cost the bank about $9 billion after taxes, since most of it is tax deductible. Also, JPMorgan said last month that it has $23 billion set aside for litigation expenses, so this was completely planned for.

Bank of America has had a pretty awful-looking string of settlements itself. Most are unrelated to any actions of the bank itself; they stem from the bad behavior of companies that Bank of American took over, such as Countrywide Financial. Settlements paid to Fannie Mae and Freddie Mac by B of A are now well over $10 billion.

When will it end?
There's really no telling at this point just how much more trouble is still on the horizon as a result of bad behavior during the financial crisis. For instance, something not included in JPMorgan's aforementioned $13 billion settlement total is the recently reported action against the bank stemming from the Madoff case. These penalties are supposedly related to the bank turning the other cheek while the Ponzi scheme was occurring and are said to be in the neighborhood of an additional $2 billion.

While I think any Madoff settlement will be exclusive to JPMorgan as they served as Madoff's primary bank even after major red flags became apparent in his operations. However, there was quite frankly too much "bad behavior" before and during the financial crisis that the possibilities for legal action have not come close to being exhausted yet.

Implications for the financial sector
In my opinion, the fallout from the financial crisis (legal and otherwise) is why the stocks of the major institutions continue to trade at historically low valuations. For example, Citigroup (C -0.32%), which has managed to avoid high-dollar settlements other than one $590 million agreement earlier this year, is trading at about 0.96 times its tangible book value, well below historic levels. Now, I don't think any of these companies will be valued at 4 times tangible book again anytime soon, but the current valuations are pricing in a tremendous amount of ongoing risk and limited profitability.

Data Source: S&P Capital IQ.

A similar statement could be made about Bank of America and JPMorgan, to a lesser extent. 

Data Source: S&P Capital IQ.

Use it to your advantage!
Being that these banks are trading at such cheap valuations relative to their historical levels, I believe that the majority of any further legal fallout or other lingering effects of the financial crisis are already mostly priced in to the stocks of these companies. Therefore, any weakness that results from news of more bank settlements should create an even better buying opportunity in these already cheap companies.

As the legal process unfolds, here, eventually we'll have a much clearer picture of just how much the legal impacts of the financial crisis affected the banks, and when that happens, we could see a big rally in the sector.