Racer do you know if it was a cash deal that was accepted? Should be easy to find out, go to the tax roll and take a look.
Sadly this sort of stuff happens in real estate and is quite unethical. Of course you cannot get the house but you CAN make things uncomfortable for that agent and his/her broker. You can go to the broker with your offer and show that broker the offer and ask what happened. If the broker has some compelling reason for why your offer was not selected such as an all cash offer or a very low loan amount, or perhaps no contingencies at all, or something like that, then that could help give you the answer you are looking for as well.
If there seems to be no compelling reason other then the agent simply wanted the best offer you can make a complaint to the DRE.
Understand this is alot of legwork on your part but if nobody complains about this behavior it WILL NEVER STOP.
I would strongly encourage you to follow up.
************
Sadly this happens alot and yeah perhaps you should consider going directly to the listing agent for an REO. However in doing so you should also abandon hope for quality representation. However if you have your wits about you, get a good physical inspector and ask someone knowledgeable for some help, then maybe it is the way to go.
Good luck with the next place and hang in there. There will be PLENTY more.