Back in the late-housing-bubble period, in 2007, Countrywide Home Loans, which was then the largest mortgage provider in the country, rolled out a new lending program. The bank called it the “high-speed swim lane,” or H.S.S.L., or, even more to the point, “hustle.” Countrywide, like most mortgage lenders, sold its loans to Wall Street banks or Fannie Mae and Freddie Mac, two mortgage giants, which bundled them and, in turn, sold them to investors. Unlike the Wall Street banks, Fannie and Freddie insured the loans, so they demanded only the ones of the highest quality. But by that time, borrowers with high credit scores were getting scarcer, and Countrywide faced the prospect of collapsing revenue and profits. Hence, the hustle program, which “streamlined” Countrywide’s loan origination, cutting out underwriters and putting loan processors, whom the company had previously deemed not qualified to answer borrowers’ questions, in charge of reviewing loan applications. In practice, Countrywide dropped most of the conditions meant to insure that loans would be repaid.

The company didn’t tell Fannie or Freddie any of this, however. Lower-level Countrywide executives repeatedly warned top executives that the mortgages did not fulfill the requirements. Employees changed data about the mortgages to make them look better, sometimes increasing the borrower’s income on the forms until the loan looked acceptable. Then, Countrywide sold them to the mortgage giants anyway.

At one point, the head of underwriting at Countrywide wrote an alarmed e-mail, with a list of questions from employees, such as, does “the request to move loans mean we no longer care about quality?”

The executive in charge of the decision, Rebecca Mairone, replied, “So - it sounds like it may work. Is that what I am hearing?”

To federal prosecutors—and to a jury in Manhattan—the hustle sounded like fraud. And in 2013, Bank of America, which had by then taken over Countrywide, was found liable for fraud and later ordered to pay a $1.27 billion judgment to the government.

But this week, the Second U.S. Circuit Court of Appeals looked at that judgment and asked this question: If an entity (in this case, a bank) enters into a contract pure of heart and only deceives its partners afterward, is that fraud?

The three-judge panel’s answer was no. Bank of America is no longer required to pay the judgment.

The Bank of America case was a rare outcome in the collapse of the financial system: a firm whose actions had contributed to the crisis was held to account by a court of law. The U.S. Attorney’s Office for the Southern District of New York, which brought the case in 2012, used an ingenious strategy, charging the bank under a law dating from the savings-and-loan crisis of the late nineteen-eighties, called Financial Institutions Reform, Recovery and Enforcement Act, or FIRREA. And the government actually identified a human being, Rebecca Mairone, claiming she defrauded Fannie and Freddie. Though it was a civil action, rather than a criminal one, the case actually went to trial—unusual in this day and age—and the jury found Bank of America and Mairone liable. (The Second Circuit panel’s ruling reversed a finding of fraud against Mairone and tossed out a million-dollar ruling against Mairone.)

The appellate-court panel accepted the main facts as described by the government. It acknowledged that Countrywide intentionally breached its contract but ruled that it had not engaged in fraud.

The ruling, written by Richard C. Wesley, a George W. Bush appointee, was unanimous, with another Bush appointee and an Obama appointee voting in favor. “What fraud … turns on, however, is when the representations were made and the intent of the promisor at that time,” [italics in the original] Judge Wesley wrote. If the fraud is based on “promises made in a contract, a party claiming fraud must prove fraudulent intent at the time of contract execution; evidence of a subsequent, willful breach cannot sustain the claim.”

The government hadn’t set out to prove Countrywide’s intentions—honorable or otherwise—at the moment it signed the contracts with Fannie and Freddie. Consequently, the court ruled that the government had not provided sufficient evidence for its contentions. “The government had zero evidence of affirmative misrepresentations at the time of the bad conduct,” Samuel Buell, a law professor at Duke University and the author of the forthcoming book “Capital Offenses: Business Crime and Punishment in America's Corporate Age,” says. But to other legal scholars, the ruling seemed nonsensical. “Is the idea that a good state of mind initially can insulate you from fraud later on?” Brandon Garrett, a professor of law at the University of Virginia and the author of “Too Big To Jail: How Prosecutors Compromise with Corporations,” asked. “That would be a very strange and troubling doctrine.” He added, “It almost seems like the Second Circuit fell victim to a lawyer’s trick.”

For U.S. Attorney Preet Bharara, the court’s ruling is yet another setback in his corporate-crime efforts. In 2014, the Second Circuit overturned one of the office’s major insider-trading cases, throwing the law in that area into disarray.

It’s tempting to read something personal into these rulings. Courts often view themselves as a check on what they see as prosecutors responding to the pitchfork-wielding mob. In the nineteen-nineties, the Second Circuit overruled several high-profile Wall Street prosecutions brought by Rudolph Giuliani, who in the eighties had been the Southern District’s U.S. attorney. Now it is doing the same to Bharara, who (as Jeffrey Toobin wrote in the magazine recently) has antagonized the bench, and is viewed by some as overly aggressive and arrogant. The ruling also bolsters the argument, so often heard from prosecutors, that they didn’t bring many big cases after the financial crisis because the laws required an evidentiary standard that couldn’t be met. “We thought it would be unfair to bring it as a criminal case, and therefore properly and fairly used our discretion to bring it as a civil case, but we thought it was clearly fraudulent," one former prosecutor familiar with the case said. The ruling, this person says, is “extraordinary and dispiriting.”

The relentless criticism of its post-financial-crisis crackdown has taken a toll on regulators. "This is a perfect example of how everyone thinks it is so easy to bring financial-crisis cases, but it isn’t,” the former prosecutor says. “The Court of Appeals didn’t agree, and now they’ve undone a major, major case tried before a jury. We get criticized for timidity in taking on financial-crisis cases, but the appeals court clearly viewed us as too aggressive. So maybe everyone who rails about the failures to bring financial-crisis cases needs to understand that there is a legal system, and what seems so obvious to them, is in fact not."

The ruling does not affect the many multibillion-dollar settlements that the government has reached with most of the top financial firms for mortgage abuses. The parties entered those settlements voluntarily. Settlements are highly unsatisfying as a matter of justice. Companies and their defense attorneys complain that the government extorts them out of unreasonable sums because they have no choice but to negotiate, while the public feels companies are not held accountable, punished only by being compelled to write checks that have little effect on their bottom line.

After this ruling, the government may be even less willing to fight it out in court. Worse, it may have less leverage with companies when trying to extract penalties and fines in settlement negotiations over misconduct allegations. The court has provided companies with a new piece of ammunition: the ability to argue that their deliberate misconduct was not actually fraud.