So the $25 billion mortgage settlement deal that was supposed to help keep people in their homes? Turns out banks have found a loophole: They’re forgiving second mortgages while refusing to modify the primary mortgage.

Quick recap: Lenders were found to have forged documents, falsified signatures, and otherwise broken the law in an effort to foreclose on people as quickly as possible. As part of the settlements reached for doing that, they were required to use billions to forgive mortgages and help people stay in their homes.

Here’s the loophole, as the New York Times explains: Banks get credit for forgiving either first or second mortgages, so they’re choosing to forgive the second loans (which, in a short sale or foreclosure, would be worthless anyway).

So a lender can forgive a second mortgage — which in the event of foreclosure would be worthless anyway — and under the settlement claim credits for “modifying” the mortgage, while at the same time it or another bank forecloses on the first loan. The upshot, of course, is that the people the settlement was designed to protect keep losing their homes.

The five banks covered under last year’s settlement are wiping out second mortgages in record numbers. 

The result: Thanks to this loophole, foreclosures continue apace. People are still losing their homes, and property values are continuing to be held down by distressed properties on the market.

Read the details from the Times.