Mortgage rates are so low that it may seem like a great time to get a mortgage. For banks, however, it probably is the greatest time ever.

The profit margin on the rates that they can charge customers and the price they can earn for selling those mortgages to investors is at a record. This is measured as the "spread," or difference, between mortgage securities yields and mortgage rates.

Given that housing prices are beaten up and borrowers must put down bigger cushions than in recent years, it is "the most profitable, safest time ever to be a mortgage bank," says Scott Simon, who is the head of mortgage investing at Pimco.

In the old days, there used to be a word for this kind of thing: price gouging.

And who is doing the gouging? Mainly, Wells Fargo and JPMorgan Chase. In the third quarter, reported in the last several weeks, both banks earned robust profits from the mortgage business.

The president of the Federal Reserve Bank of New York, William C. Dudley, vented this frustration in a recent speech, blaming the concentration of mortgage-making power at a few big banks.

Mr. Dudley is right. But what he didn't say was that his own institution (the Fed), his former boss (Treasury Secretary Timothy F. Geithner) and the Bush and Obama administrations delivered us this mess.

The broken mortgage market is the unintended consequence of the flawed banking bailout and the flaccid regulatory response in the aftermath of the financial crisis.

The government and the regulators have had two broad approaches to banking oversight during the crisis and its aftermath. First, regulators coddled the troubled big banks. The two weak behemoths, Citigroup and Bank of America, were granted time to work off their bad loans. Regulators practiced forbearance, overlooking the self-inflicted debacles — mostly housing related — on their balance sheets.

Regulators, meanwhile, encouraged the healthy giants to get even bigger by gobbling up the small and weak. So Wells Fargo bought Wachovia, and JPMorgan snapped up Washington Mutual.

It would be foolish to blame Wells Fargo and JPMorgan for this situation. Restaurants with 100 customers waiting in line outside the door wouldn't, and shouldn't, be expected to lower their prices; why should banks?

Yet allowing takeovers without forcing weak competitors to get healthy quickly leads to an oligopoly. Exhibit A: Wells Fargo and JPMorgan dominate the mortgage business. They should face some competition. Instead, their biggest threats, Citigroup and Bank of America, are, astonishingly, pulling out.

Citigroup and Bank of America appear to have made a profound mistake. It's one of the many strategic errors that ultimately got Vikram S. Pandit ousted as Citi's chief executive. Mr. Pandit viewed mortgages as a "noncore" business for Citigroup. Whoops.

But it's not a surprising one. These are traumatized institutions, limping along, preoccupied by the past and unable to look forward, says Sheila Bair, the former chairwoman of the Federal Deposit Insurance Corporation and author of the new crisis account, "Bull by the Horns." She rightly calls it "another downside of the bailouts. We simply propped up weak institutions instead of making them restructure."

The odd twist is that the Federal Reserve is a victim here, too. Despite its move to buy mortgage-backed securities in its latest round of extraordinary measures to lower interest rates, it can nudge them only so far because of the dysfunctional, noncompetitive market.

Regulators could have broken up Citigroup and Bank of America, spinning off their mortgage operations into well-capitalized, nimble competitors. Perhaps they could have forced those banks to take big write-downs on their mortgage assets, settled their lawsuits and moved on, putting the past where it belongs.

Bankers, of course, don't like this analysis. It's common for them and others to argue that what's really ailing the mortgage market are delays in putting new Dodd-Frank mortgage rules in place, like the ones that define the standards for mortgages that can be bundled into securities.

And, yes, that is probably hindering new competition from entering the market, though it certainly can't fully, or even mostly, explain Citigroup and Bank of America abandoning the field. And, of course, the banks themselves bear much of the blame because they went all out to obstruct the rollout of new regulations. But, ultimately, the Dodd-Frank delay is yet another example of how the government's inefficient postcrisis process has hurt the marketplace.

There has been plenty of talk about how the government saved the financial system after the crisis. And it did. Now the question is: Is this what we saved it for?