Just how did the biggest bank fraud in the nation’s history go on with the full knowledge of authorities for 7 years?

Apparently, without much trouble.

Earlier this week, a judge sentenced Brian Farkas to 30 years in prison. He was the head of one of the country’s largest non-depository mortgage companies, convicted of a multibillion-dollar fraud that has been labeled the largest in the country’s history. The case was brought to prosecutors by the bailout’s former special inspector general – after a bank associated with the mortgage company tried to rip off the Troubled Asset Relief Program for $550 million.

Prosecutors said they sought the tough sentence as a deterrent, though bankers might not get the message.

Writing in the New York Times, white-collar criminal law expert Peter Henning said more respectable executives at bigger companies “perceive themselves as different from – and often better than – those who have been caught and punished, even if they are not.”

But one of the most outrageous aspects of the case has nothing to do with Farkas’ behavior: It has to do with how a government-sponsored  agency, Fannie Mae, found evidence of his wrongdoing  in 2000 and didn’t report it. According to court testimony as reported by Bloomberg News and the New York Times, when Fannie Mae found out that the bank was selling loans that had no value, the agency merely cut its ties with the bank.

Another government-sponsored agency picked up the business a week later, Bloomberg reported.

William Black, a former bank regulator who has been a sharp critic of the current administration’s lack of aggressiveness in investigating fraud in the wake of the 2008 financial collapse, told Bloomberg: “If there had been a criminal referral, Farkas would have gone to jail in 2002.”

Farkas’ firm, Taylor Bean remained in business for another 7 years before it collapsed in August 2009.

The confidential agreement to disentangle Freddie Mac from Taylor Bean was overseen by Freddie Mac’s general counsel, Thomas Donilon, who now serves as national security adviser to President Obama.

It’s not the first time Donilon’s actions have been called into question: while he was a lawyer in private practice, he led lobbying efforts to undermine the credibility of an investigation into Fannie Mae’s shaky finances in 2004.

It’s worth cheering that prosecutors finally successfully prosecuted a major case stemming from mortgage crowd. But it’s also worth noting that the perp does not come from the ranks of the nation’s too big to fail banks.

It’s also worth noting that Donilon’s conduct in the financial collapse didn’t get him cast out as a pariah, it won him one of the most important jobs in this administration.