As a legal drama, it has gone on way longer than most people's attention span can tolerate. But the plot continues to thicken in the quest for villains responsible for the 2008 financial meltdown.

The Obama administration and six states are suing credit-rating agency Standard & Poor's for insisting that hundreds of billions of dollars' worth of securities were far safer than they turned out to be. If the government wins, it would mark a rare moment of accountability for a scandal in which hardly anybody has been punished—even though the wipeout zapped trillions of dollars of wealth and threw nearly 10 million people out of work.

For two decades, it had been typical practice to bundle mortgages into tradable securities to optimize their value. The process worked fine as long as the mortgages themselves remained in good standing, even pushing down interest rates and freeing more cash that banks could lend to worthy homeowners.

The problem developed when mortgage lenders began granting loans to unqualified borrowers who should not have gotten them. When home values started to fall, the home equity many of those borrowers had been counting on evaporated, and default rates skyrocketed.

This photo from Oct. 9, 2011, shows 55 Water Street, home of Standard & Poor's, in New York. (Henny Ray Abrams/AP)

The system failed because nobody accounted for the high proportion of risky loans that ended up rolled into mortgage-related securities, a huge asset class that amounted to at least $3 trillion worth of investments by 2007. Brokers earned fees for each loan they originated, which gave them an incentive to ignore underwriting standards and write as many loans as possible, and even commit fraud.

Banks that made the loans became accustomed to selling them off as investments, reducing their own interest in validating the quality of the loan, since they'd no longer be holding it if something went wrong.

The rating agencies—including Moody's and Fitch as well as Standard & Poor's—were supposed to be final backstops assuring the quality of the loans that made their way into mortgage-backed securities. The Wall Street banks that assembled and sold mortgage-backed securities typically aimed for a triple-A rating, the highest, because pension funds and other big investors followed rules requiring their investments to be in high-quality assets. Anything rated AAA was considered extremely safe, nearly as low risk as U.S. Treasuries.

That assessment turned out to be wildly off the mark. As mortgage holders began to default in record numbers, investors holding mortgage-backed securities began to suffer large unexpected losses that raised doubts about every triple-A rated security. Worse still, many Wall Street firms had sold derivatives linked to MBSs, which were essentially bets on the direction of the housing market. Many of those bets went sour, with anything linked to mortgages suddenly considered "toxic waste."

Banks started piling up losses, culminating in the panic that gripped markets when Lehman Brothers failed in September 2008. Even bigger firms such as AIG and Merrill Lynch—the backbone of the financial system—looked as if they might topple next, triggering the unprecedented and deeply unpopular Wall Street bailouts.

Bogus assessments by the three credit-rating agencies were key enablers of the wipeout. "The failures of credit rating agencies were essential cogs in the wheel of financial destruction," the Financial Crisis Inquiry Commission wrote in its final report, in 2011. "This crisis could not have happened without the rating agencies."

The big question, obviously, is why the rating agencies got it so wrong.

The government lawsuit contends that S&P committed fraud by deliberately inflating its ratings on hundreds of billions of dollars' worth of securities, and by delaying downgrades even when it knew the quality of those assets was "severely impaired." The suit doesn't specify the damages the government is seeking, but it claims that federally insured financial institutions lost more than $5 billion on assets rated by S&P.

The case will undoubtedly focus on the "issuer pays" model in which banks creating securities pay the rating agency for its opinion, which is essential in marketing the securities. The potential conflict is that the rating agency may be pressured to inflate its opinion of a product being sold by a paying client. The suit alleges that S&P overstated the quality of securities it rated due to a "desire to increase market share and profits." Since Moody's and Fitch operated by the issuer-pays model as well, it's possible those firms could face lawsuits too.

S&P has acknowledged that its AAA ratings on many mortgage-related securities turned out to be wrong, but it denies committing fraud. The firm insists the bad ratings were honest mistakes made at a time when few bankers, investors, or regulators saw the dangers posed by out-of-control subprime lending. Even Federal Reserve chairman Ben Bernanke famously downplayed subprime risks, saying in 2007 that "we do not expect significant spillovers from the subprime market to the rest of the economy or to the financial system."

Another hurdle the government will face is that S&P isn't exactly a blingy Wall Street bank. It's an information company with profits that are a fraction of what Wall Street's money barons earn. S&P's parent firm, McGraw-Hill, earned a respectable $911 million profit in its most recent year, but that's puny compared with annual profits of $7.5 billion at Goldman Sachs and $21 billion at J.P. Morgan Chase.

So while the government wants to be tough on S&P, it also has to be careful not to wreck the whole company and threaten the jobs of innocent bystanders. The plot will continue to thicken.