The right thing for the landlord to do is to give you the money back but if you didn't sign anything, I don't think he is obligated to.
If he/she changes their mind in renting to you they should return your security deposit but the earnest money is taken in order for the renter to have the reasonable time to sign a lease agreement and the landlord to pull the rental of the market. But keep in mind this security deposit can be held for a reasonable time until you move in. By this I mean if you place a security deposit today the landlord is not going to wait over a month for you to sign a lease contract. Best of luck.