Is it legal to have 2 contracts signed by 2 different clients on the same house?

Question Details:

We found a home and made an offer and had contracts drawn up and put $500 down. Before our contracts were drawn up two other offers came in. Our contracts have been signed but we were just told that another set of contracts were signed as well for the same house. The listing agent told our agent that they will go with our offer because we had paperwork drawn up first only if we can match the down payment price of the other offer. Its a 50k difference. The home is a short sale. Important Notice