I don't know exactly what mortgage contracts look like in the US, but the ones I have seen in my country don't say you <i>can</i> walk away.  They say you can <i>not</i> walk away.   The bank getting the house is just one consequence that happens if you <i>violate</i> the contract and <i>do</i> walk away.