Whether you, as a jilted home seller, can keep the buyer's earnest money deposit depends both on how the purchase agreement was written and the facts of how the deal fell apart.
It's true that in some situations, a home buyer who backs out before the close of escrow forfeits any right to the earnest money. The purpose of earnest money is to compensate the seller for wasted time and expense if the buyer simply gets cold feet or changes his or her mind, and breaches the terms of the agreement in order to back out.
Here's what you, as the home seller, should do next.
You should have a copy of the agreement that both you and the would-be buyer signed. It very likely contains "contingencies," or conditions under which the buyer could back out of the sale without it being considered a breach of contract. If there was no breach, the buyer has every right to a return of the earnest money.
One of the most common contingencies is for mortgage financing. A buyer doesn't want to be bound to go through with the deal if he or she can't, in the end, get a reasonable loan.
Preapproval for a loan doesn't mean a lot in this situation; even after issuing a preapproval, the lender has the right to reevaluate the borrower's existing debt, income, and general financial position, and could finally deny the loan outright; up to or on the closing day, no less.
Another common contingency is for a home inspection. A buyer wants to be allowed to hire a professional to examine the house, and then back out or renegotiate the purchase if repair needs come up that the buyer finds unacceptable. This contingency is, unfortunately for sellers, easy to draw on when a buyer wants to back out of a deal. Almost no house is completely free of defects, and the buyer can easily point to one as the basis for refusing to follow the deal through to closing.
To avoid sellers having to wait until closing day to find out whether one of the buyer's contingencies will be used to cancel the deal, your contract probably also set dates by which action needs to be taken and each contingency removed.
If the buyer in this case actually got an inspection, was happy with the results, and removed that contingency, then it can no longer be used as a basis upon which to back out of the purchase. The same goes for the financing and other contingencies.
Your real estate agent will know whether all the contingencies have been removed by the buyer prior to the deal being cancelled.
It sounds as though you haven't yet gotten a clear answer on why, exactly, the buyer is backing out. Although things were apparently going swimmingly with regard to both the mortgage and inspection contingency, it's possible that last-minute issues arose, which somehow weren't conveyed to you.
Again, if one of the contingencies or another term of the contract allowed for cancellation of the deal, you are not allowed to keep the earnest money.
Even if the buyer did breach the agreement, however, consider whether you have really been damaged by that act. If it was a large deposit, and real estate prices have actually gone up a bit in the last month, perhaps punishing the buyer is not worth the arguments, or even lawsuits, that might result.
The buyer's true reasons for backing out might affect your thinking on this, too. For instance, what if the buyer was moving for the sake of a job, but the company just went bankrupt and the job disappeared. Do you really want to play hardball? You wouldn't be the first seller to show mercy and move on to the next buyer without demanding every last penny of the earnest money deposit.
If it's a true breach of the contract, however, and you can't come to an agreement, you might want to look at the dispute resolution portions of the purchase contract. In the worst case, your state law might allow you to get a court order forcing the buyer to purchase the home.