BARACK OBAMA'S decision to veto a little-noticed bill requiring local courts to recognise mortgage documents notarised outside the state, which critics worry might exacerbate mortgage fraud, doesn't give one a lot of confidence that Congress is doing its job well.

Democrats were trying to figure out Thursday how they allowed a bill to pass that critics say would introduce more fraud into the system, a Pelosi staff member said. It was sponsored by Rep. Robert B. Aderholt (R-Ala.), the first measure he sponsored that passed. Even he was surprised that it sailed through, his spokesperson said.

I have a wild guess as to how this happened: The bill was written by savvy financial-industry lobbyists, and nobody in Congress understood the implications. Fortunately, banks foreclosing on houses without actually possessing proper documentation has blown up into a huge issue over the past couple of weeks. That created a rare opportunity for politicians to do the right thing on the sort of shadowy regulatory issue where special interests usually wreak their fiendish will in tiny fonts.

Read enough stories like this, and you get the impression that Congress is composed of publicity-hungry dullards at the mercy of moneyed interest groups. But I would like to put forward a controversial proposition: a lot of congresspeople are actually very smart, decent folks trying to do the best job they can for the American people. Witness Ezra Klein's interview with congressman Brad Miller. They're talking about a related and more significant mortgage issue, which is that the discovery that banks often don't have proper documentation on their mortgages is driving investors who've purchased mortgage-backed securities to sue the banks to buy those mortgages back. If the suits succeed, the banks could be insolvent again.

Ezra Klein: What's happened to the mortgage market? It's odd to say that the new foreclosure crisis is that the foreclosures have had to stop, but that's the new reality, right? Brad Miller: There is massive potential liability for the securitizers, which are mostly the biggest banks. The contract was that if mortgages didn't meet certain requirements, then the securitizer would buy them back. The mortgage servicers and trustees have exclusive control over the paperwork. Both the investors, the people who own the mortgage-backed securities, and the homeowners, really depend on them. There's been lots of litigation where investors try to get securitizers to buy back the bad mortgages because they were flawed, but that litigation has been stymied by procedural objections. If the private investors can break through that defense and require the mortgages that don't meet the requirements to be bought back, the liabilities for the biggest banks will be enormous. EK: So this is, in other words, a problem for bank balance sheets. These banks bought the mortgages from individuals, packaged them into securities, and then sold them to investors. But because the mortgage contracts weren't valid, the investor can potentially force the banks to take the mortgages back, thus blowing a new hole in their balance sheets? BM: Right. They'll have to buy them one mortgage at a time. Someone said there might be a second round of bank insolvencies because of this and there might need to be more TARP. There is no chance that Congress would pass more TARP.

The shocking conclusion here is that Mr Miller is a very smart guy who understands banking and mortgages, and is genuinely dedicated to resolving the problem of mass foreclosures and homeowners saddled with unsustainable debt while guaranteeing the health of the financial system. And Mr Miller isn't the only denizen of Congress who's a smart, decent fellow. During the financial reform discussions, it became clear that senator Bob Corker had an expert's grasp of the issues at hand and was committed to reform and open to making some compromises...until the bill neared a vote, anyway, at which point he found that a few niggling points and a sense of personal betrayal were excuse enough to hold with his party and vote against it. Representative Alan Grayson, who often comes across (deliberately) as a rabble-rousing blowhard, is actually an extremely smart guy who has occasionally been spotted having earnest policy discussions with opposing constituents who can back up their views in an intelligent fashion.

These people aren't mindlessly partisan carney barkers, but they often play them on TV. Why? My working theory is that it's generally because we, the voters, demand it. We're frequently angry, and we're not very smart. But that's not something that's likely to change, and I don't really think that policymaking would get better if voters just left politicians to make policy without bothering them too much. (After all, it was the prospect of voter anger that created the pressure needed for Mr Obama to veto the mortgage-certification bill.) Rather, I think one of the things you have to recognise about politics is that it's to a great extent composed of very smart people forcefully saying things they know aren't entirely true, in order to retain the support of the public to do the complicated things they know are actually in the public interest. Mr Miller's statement that "there is no chance that Congress would pass more TARP" is a case in point. As pretty much everyone in the punditocracy has by now pointed out, TARP has been one of the most successful single pieces of legislation in the history of American government. It saved the world financial system for somewhere between $66 billion and $0 (or, perhaps, a profit of a few billion dollars). But we, the voters, hate it. If Congress wouldn't have the ability to do the same thing again, it's because of the people who elect them, and that's a pretty serious indictment of us.