<human>: Can you succinctly summarize the text in 1-3 sentences?

About 3 weeks ago my gf and I signed the lease for our own place for this upcoming Fall. When we signed we wrote the checks for first and last months rent, security deposit, and realtor fee. They cashed the checks the very next day when I looked at my bank account. We were told that as soon as they get first months rent they take the listing off the market and which to my understanding means that, assuming the applications goes through fine, we get the apartment. Yesterday my girlfriend calls me, freaking out, at work and says that she just got a call from the realtor saying that we aren't getting the apartment because they gave it to someone else. I called the realtor myself and she told me the building owner decided to give the apartment to someone that submitted an application 3 hours before us through a different realty company. She then goes on to tell me how there is another apartment that is identical to the one we signed the lease for, just on the other side of the hall and that we can take a look at it and the building owner will hold it for us if we are interested. We have an appointment set up tomorrow to take a look at it. 
I'm terrified that this other apartment is gonna be some shithole and they're gonna expect us to pay the same rent for it, but i'm willing to take a look in the off chance that it may be in our benefit.

So my questions for anyone that knows anything about this kinda stuff are:
-How often does this kinda thing happen?
-Is this even legal? They took the money from us but gave the apartment to someone else...wtf?
-What should my course of action be when I see the realtor face to face tomorrow?
-What can I do to put things in my favor in this situation?

I'm trying to be as rational about this as possible. Any advice will help!
<bot>: Paid realtor/bulding owner for apt, they took money and gave it to someone else. Now offering us a "similar" apartment? What to do?