One consideration would be that cancellation of a debt becomes income. However, as you can find in many discussions here, if your foreclosed and the sale of the property does not return enough funds to fully satisfy the debt, the deficiency is normally not forgiven. Instead you remain owing that amount and the lender will presumably continue to try and collect it. However, the portions of previously unpaid debt that are from interest charges on the loan, (when that loan was qualifying for the interest deduction as being on your primary residence (and other factors)), and would have been deductible had you timely paid, should be includable as tax deductible interest costs to you in the period actually paid. Cancellation of debt does not typically apply on the foreclosure of a home, as far as being treated as straight income. A foreclosure is treated the same as the sale of a home. Your cost-basis of the house will stay the same as if you sold the house. The amount of debt forgiven is treated as your sales price. This will create either a Capital Gain or a Capital Loss. It is possible to claim a Capital Loss for your home, to determine if your specific circumstance meets the criteria refer to IRS Publication 523. Complete the worksheet for computing your home's adjusted basis to determine if you have a capital loss or gain resulting from the foreclosure.
http://www.irs.gov/publications/p523/index.html If you end up showing a capital gain, you may still use the home exclusion rules to exclude up to $250,000 of that capital gain ($500,000 for married filing joint). ie. if you lived in the home for 2 of the last 5 years, etc.