In early 2006, as California's real estate bubble was beginning to burst, an elderly Los Angeles couple, Fannie Marie and Milton Gaines, fell behind on their mortgage payments and received a notice of default from their lender, Countrywide Home Loans. Hoping to avoid foreclosure, the couple agreed to a plan suggested by Countrywide: They would obtain a loan modification provided by a third party, a businessman named Joshua Tornberg. What the Gaineses didn't know, however, was that Tornberg was the fiancée of the Countrywide employee who made the recommendation. And instead of saving the Gaineses' house, Tornberg scammed the elderly couple, recorded an altered deed, and extracted $240,000 from the property before walking away, according to court documents.

Then things really went to hell. In August 2006, Milton Gaines died, leaving his wife to battle two banks, a title company, a mortgage servicer, and Tornberg. Fannie Marie Gaines filed suit against Countrywide, Tornberg, and others involved in the fraud. Then, in 2009, she passed away, too, but their son pressed forward with the lawsuit.

The case, however, was tied up in Los Angeles County Superior Court for six years as Countrywide and the other defendants filed counter-motions and stalled. Countrywide eventually reached a settlement with the Gaines family, but the company's actions, and the alleged fraud its employee initiated, remained central to the case against the other defendants. Further, mediation with those defendants — Fidelity National Title Company, Lehman Brothers bank, Aurora Loan Servicing, and Tornberg — ultimately failed. In August 2012, a superior court judge dismissed the case on a legal technicality: It had taken more than five years to come to trial. The Gaineses' lawyers appealed, but two Second Appellate District Court judges denied the appeal, tallying yet another victory for the banking industry.

One of the appellate court judges on the three-judge panel that heard the case penned a dissenting opinion. "This case was one of hundreds, perhaps thousands of lawsuits that grew out of the financial meltdown," explained Justice Laurence Rubin. Writing that he would have reversed the superior court's ruling entirely, Rubin concluded, "[I]n my view the dismissal of this lawsuit under the circumstances described defeats the substantial ends of justice. Instead, it rewards parties who, it would appear, have played a major and unlawful role in the theft of someone's home."

The Gaines case was one of thousands of similar losses by California homeowners in state courts during the past several years. The legal setbacks have demoralized homeowners and their attorneys and caused them to question the integrity of California's justice system. Some attorneys who have sparred with the giants of the real estate industry say California's courts exhibit an institutional bias in favor of the banks: The banks are said to be too big to fail and too big to jail.

"My experience was that there was a general institutional bias towards business," added Donald Adams, Jr., a former attorney who represented homeowners against banks and mortgage servicers during the past six years. "There was a cynicism that an individual borrower challenging a lender's loan practices was driven by economic motivations only."

Adams believes that the deference most judges have shown to the banks has done enormous damage to the economy. "Had courts enforced the law against the lenders the Great Recession did not have to occur," he said. "Many of us were after the New Centurys, the Ameriquests, and Countrywides well before the collapse. Even after the economy imploded, most judges did their best to protect the business interests of the predatory lenders by cynically not wanting to let the consumers off the hook for taking out loans they had trouble paying back.

Homeowners, of course, weren't the only parties in court looking out for their economic interests. The banks have resisted lawsuits brought under state consumer protection laws in order to maximize their profits from the foreclosure crisis.

But there's also the issue of the potential economic motives of the judges themselves. For example, the two appellate court judges who dismissed the Gaines case had significant personal financial investments in banks and mortgage lending companies, public records show.

Judge Elizabeth Grimes, who voted against the Gaineses, owned between $100,000 and $1 million worth of stock in Bank of America, according to official records maintained by the state Fair Political Practices Commission. Bank of America purchased Countrywide in 2008. According to the state Code of Judicial Ethics, judges are required to disqualify themselves from any case in which they own stock or bonds with a fair market value exceeding $1,500.

"By the time the case came up for appeal, Countrywide was no longer a party to the action," Joseph Lane, clerk of the Court of Appeal for the Second Appellate District, wrote in an email, explaining why it wasn't considered a conflict of interest for Grimes to be involved in the appellate ruling.

But records show that Bank of America wasn't Grimes' only large investment in the banking sector. She also owns between $100,000 and $1 million of stock in Wells Fargo and US Bank, and between $10,000 and $100,000 in Citibank, giving her potentially a multimillion-dollar interest in the profitability of the mortgage lending industry.

In addition, Judge Patricia Bigelow, who wrote the majority opinion against the Gaineses, owned possibly as much as $10,000 worth of stock in Bear Stearns, an investment bank that was responsible for securitizing trillions in mortgage loans in the 2000s. Bear Stearns was bought by JPMorgan Chase in 2008. Even the dissenting judge, Rubin, had a stake in the mortgage industry, owning thousands of dollars worth of Wells Fargo stock. And the Los Angeles County Superior Court judge who originally dismissed the case, Rolf Treu, owned as much as $10,000 worth of stock in Citibank.

Patricia Rodriguez, an attorney who has brought homeowner lawsuits in multiple counties, said judge ownership of financial company stocks is just more evidence of the broader justice system bias in favor of banks and against homeowners. "In general, the judges are unfair to borrowers," she said. "I've seen cases where the judge made a prejudiced statement before trial, saying of a plaintiff, she's 'trying to get a free house.'"

Potential conflicts of interest have been common over the past six years as the courts have been flooded with cases of homeowners suing their mortgage lenders and servicers. Forty-two of California's 105 appellate court judges (or 40 percent of the bench) own significant amounts of stock in at least one financial company. Seventeen justices disclosed owning stock or bonds in Bank of America in 2012, the most of any bank, followed by Citibank with ten judges owning at least $2,000 in securities. Five judges own stock or bonds in JPMorgan Chase, while four judges have investments in Wells Fargo. These four banks are the largest mortgage lenders and servicers in California, and also the most commonly sued by homeowners for alleged illegal practices used to foreclose or defraud consumers.

Public records also show that judges sometimes appear to have direct conflicts of interest. In 2012, for example, the Second District Appellate Court ruled in favor of Bank of America and threw out a lawsuit brought by Daniel and Yvette Shuster of Simi Valley. The Shusters alleged a wrongful foreclosure and breach of contract. One of the judges who ruled in that the case, Arthur Gilbert, held stock in four different financial companies that originate or service home mortgage loans, including shares worth as much as $10,000 in the defendant Bank of America.

In 2011, the Second District Appellate Court granted Bank of America's petition to dismiss charges of fraud against it in another case. And then the following year, the same court tossed out another fraud case against Bank of America and Countrywide. One of the judges who ruled in favor of Bank of America in both of these cases — Judge Joan Klein — owned thousands of dollars worth of stock in the company. Klein disclosed owning at least $12,000 in Bank of America stock in 2011 and 2012. She also disclosed owning at least $10,000 in Citibank stock.

Neither Klein nor Gilbert responded to requests for comment for this report. Judges who fail to recuse themselves from cases in which they have a direct conflict of interest may be disciplined by California's Commission on Judicial Performance. However, the commission rarely metes out stiff sanctions to judges.

Some legal observers, however, believe that judges aren't swayed ideologically by their individual financial portfolios or their economic interests in the mortgage industry. "If a judge owns a nominal, or small amount of stock in a company that comes before him, it's not a sure thing a judge should have disqualified himself," said Charles Geyh, a professor of Law at Indiana University who studies judicial ethics.

According to Geyh, it's not uncommon for judges to manage personal investment portfolios that include major corporations, many of which often come before the courts. Judges begin their legal careers as lawyers, often amassing considerable wealth before ascending to the bench. Geyh said it's typical for people of their economic profile to have diversified stock holdings that include financial institutions.

Geyh added that many lawsuits against banks are small cases, unlikely themselves to have any measurable or long-term impact on the value of a bank's stock. "Let's say it's a small case in which the impact on the company will be marginal — then it's probably not a big deal," said Geyh, drawing the conclusion that a judge won't feel disinclined to rule for a plaintiff against a bank if his or her case is solid.

But attorney Patricia Rodriguez said the fact that so many judges have significant financial investments in the banking and mortgage industry means that they're inclined to rule against homeowners because a string of cases against the banks could reduce the profitability of the entire sector. "They don't want to be the judge that allows forty million mortgages to go back to the borrowers," Rodriguez continued. "They don't want to possibly set a precedent."

A series of cases decided in favor of homeowners against the banks could establish a precedent that would make it easier for borrowers to win lawsuits against their banks. The banks losing more often in court could have sweeping impacts on their profitability in California because they would have to absorb loan write-downs, rescind foreclosure sales, and modify loans in the favor of borrowers. Under this scenario, the stock prices of all the banks that conduct mortgage lending and servicing in California — many of the same banks that dozens of California judges own large stakes in — would likely be negatively affected.

But Cathal Conneely, a spokesperson for the Judicial Council of California, Administrative Office of the Courts, argued that the widespread ownership of financial company stocks and bonds by the appellate court judges isn't an ethical or legal problem: "Not in the context of the checks and balances that exist within the justice system, or in terms of the integrity of the judiciary."

"Justices are required to submit their Form 700s to the California Fair Political Practices Commission annually," said Conneely, referring to the disclosure documents I used for this report to identify which and how many judges own financial company stocks and bonds. "Judges and justices swear an oath; abide by a code of judicial ethics; receive two mandatory ethics trainings when they take office, followed by additional required ethics training once every three years; and they are subject to review by the Commission on Judicial Performance."

Geyh said the difficultly borrowers are having with banks in and out of court might be more likely due to systems outside the courts, and not under the control of the judges, that empower banks over their customers in lots of settings. "You can't blame the judge," he said. "You blame a regulatory structure that is entrenched.

"You have a period in time in which there's a lot of sympathy for homeowners," Geyh continued. "Add to that the judges own a significant chunk of the industry, it's bound to create bad feelings and perception issues."

These issues of fairness, real or perceived, reach down to California's trial courts as well. In Alameda County, fifteen superior court judges disclosed ownership of stocks or bonds in financial companies in their most recently available disclosure filings. Eight Alameda County judges own stock in Bank of America, four in Wells Fargo, and two in JPMorgan Chase, and two in GMAC, the mortgage lending arm of General Motors that is now named Ally Bank. One-third of Santa Clara County Superior Court judges own stock or bonds in financial companies, with the most common investments being JPMorgan Chase, Wells Fargo, Bank of America, and Citibank.

"It was very clear that there is one form of justice for the small borrower and another form of justice for the moneyed interests," said attorney Adams, who is retired and who, as a result, says he is now free to state these things publicly without fear. "It pains me to say that, but having seen the real estate debacle and the judiciary's protection of these fraudulent practices, I have reluctantly come to that conclusion."