Back in eary days, there are a lot of cases in which the sellers cheats the buyers, such as covering up damages, etc. The laws are also designed to protect buyer from "buyer's remorse" and compulsive buying.
As real estate transaction involves very big amount, the law lets the buyers to think twice on every stage of the process and let the buyer to get out when they feel they can not afford it.
That's why there is a term called "as is" in a real estate transaction. When an "as is" clause is signed, the buyer can not get out of the deal or lose the deposit.