You are obligated to do what your contract says. Your contract says you can walk away and the bank gets the house. If the bank didn't like that potentiality because they were speculating on a loan, then apparently that's all of our problem.
In saying that, in some states, bankruptcy is the only way to cleanly walk away from your home.
Before the crash, I was getting calls from lenders trying to get me to do a cash-out refi "so I'd have money to invest in the stock market". I assume that some went for that pitch.