there may also be the issue of credit score.  if you file for bankruptcy, it's harder to get a loan in the future.  the prospect of future loans may be more valuable than the difference between what you owe the bank and the value of your house.  that said, i suspect most people aren't thinking about this