Foreclosures are being stopped because the purported mortgage holder cannot prove it holds rights to the mortgage. Those cases do not remove the mortgage entirely, but only stop the foreclosure. More can be done.
Section 506 (d) of the Bankruptcy Code will permanently void a mortgage if the claim is disallowed. This can be easier than you think. With so many mortgages being sold and resold, the electronic transfer of the funds moves much faster than the papers. Sometimes the paperwork is never completed.
In In re Long, 353 B.R. 1 (Bankr D MA 2006) (Somma, J.), the bankruptcy court permanently voided a mortgage where the holder could not prove it held rights to the mortgage. Logically, a previous mortgage holder does not have any more rights to the mortgage since it sold them off (although this was not mentioned in the opinion).