Except your mortgage is secured by an asset, the sale of which removes most, or all, of the debt. It's a desperate option, but it's there, no bankruptcy needed. Medical debt and unsecured debt have no such option -- and student loans can't be discharged even in bankruptcy. It's not the same situation.
Yeah, that does sound hard. I’ve never had a mortgage myself, but the thought of owing tons of money on an underwater mortgage is not appealing is not appealing.
It beats paying rent. If at the end of my mortgage payments, if my house was worth half of what it was today, and my rent had never increased, I'd come out ahead. And both of the above are incredibly unlikely.