I'm not certain this is what you have, but if a lender writes off your bad debt they can report that to the IRS. The IRS will count the balance as income and require you to pay taxes on it the year it is reported.
That seems unusual for a mortgage though... I'd expect them to foreclose the house.