That is true in some states, but since real property (land) is decided by the "contract law" of that state each state has different outcomes. My Brother-in-law had a house contract fall through and the real estate agent just mailed him the earnest money and put his house back on the market.
If your realtor actually received the earnest money it should show in his trust account. Ask to see the receipt of the earnest money. If he refuses to show you, go to the local Board of Realtors. If you had a signed accepted contract, the earnest money could not be released without your permission.