You signed a contract to buy a house for $300K and you put a deposit of 5% which is $15K.
Then the market goes down and the house now only worth $280K. Most people would think it does not worth it to buy the house to save the $15K as you can buy the house at $280K. If you walk away, then buy at $280K, even if you lost the deposit, you would still save 5K.
Right?
But, the real problem is that you will have to come up with $14K again to purchase the house if you want to put 5% down, which is required by most loan programs. This is the real money from your own pocket.
If you honor your contract and buy it at $300K, you don't have to spend any more money from your own pocket. The lose of $20K will be not be real lose when the market turns back and the house appreciate.
One of the major principal of investing is to use the money from the bank as much as possible and use your own capital as less as possible.