NEW YORK ( TheStreet) - Wells Fargo's ( WFC) significant exposure to the US housing market created a mess during the housing melt down in 2008-09, whereupon the bank accepted $25 billion from Troubled Asset Relief Program (TARP).Most other Wall Street banks experienced similar turbulence during this period due to mortgage related exposure including competitors Goldman Sachs ( GS), JP Morgan ( JPM), Citigroup ( C), UBS ( UBS) and Bank of America ( BAC). Wells Fargo is a diversified financial services company headquartered in San Francisco. It is the fourth largest bank in the U.S. by assets and the second largest bank by market cap. It is also the second largest bank in deposits, home mortgage servicing, and debit cards in the U.S. The mortgage division is Wells Fargo's largest value driver constituting nearly 30% of the firm's value. However, a recent ruling by a Massachusetts court against Wells Fargo in a foreclosure case indicates a trend that could result in downside to our $37.92 Trefis price estimate for Wells Fargo's stock. Wells Fargo's mortgage revenues nearly tripled in 2009 due to an improvement in the economic environment resulting in lower credit losses in addition to the acquisition of Wachovia Corporation. In 2009 Wells Fargo's fully repaid the U.S. Treasury's $25 billion Troubled Asset Relief Program (TARP) Capital Purchase Program (CPP) preferred stock investment, including related preferred dividends. The highest court in Massachusetts ruled that Wells Fargo & Co. and U.S. Bancorp could not foreclose on homes where loans were not repaid over the doubt that home loans were not properly handled when they were securitized. The court's decision to void the foreclosure sales of two homes in Springfield came as owners of the loans couldn't prove that the mortgages had been assigned to them. Both loans were packaged as mortgage-backed securities and sold to investors. The poor documentation of mortgage loans made it difficult to trace ownership and enforce legal issues. The case has come as a potential blow to Wells Fargo and could set a precedent for other cases. This could have a large impact as we estimate mortgage backed securities (MBS) to be about $3 trillion (making up nearly 22% of the total mortgage debt outstanding in the U.S., down significantly from 53%, or $7.5 trillion, in 2009).