the pit man said:
A buyer can walk away from any purchase for any reason he wants too. The earnest money must be returned before the property can be sold to another buyer. I found this out with the last house I sold, the buyer put down earnest money, then decided he didn't like the race of one neighbor and backed out. I refused to release the escrow and hired an attorney. The attorney said that the house could not be sold until the escrow was released.
He said I was pissing in the wind because no court would force someone to buy a property that they didn't want. I ended up having to release the money. Your millage may vary...
Was this during the option period, or after the option period expired? Been 20 years since I bought or sold a house, but as I recall the buyer can back out for any reason during the option period, but after the option period expires they forfeit the earnest money if they back out. In the case you described, if it was after the option period I would've been tempted to keep the money and list the house again even if it meant going to court. The court may not force the buyer to buy a house they don't want, but they could tell them they lose their earnest money. Easy for me to say in a hypothetical when it's not my money or house, but I would've been tempted to do so.