On the surface it appears you have every right to by upset. However, without a complete understanding of the details surrounding this event, it is impossible to try to make sense of it.
Many questions come to mind:
Did you submit a formal written offer?
Were you working with an agent?
Did you provide a deposit?
Did you request special considerations?
Were you pre-approved for financing?
Was the other offer a full cash offer?
Are you certain the seller recieved your offer?
As presented, this just flat out doesn't make sense........But there are always reasons