Hello Tracy and thanks for your question.
If the foreclosure took place within the first 30-45 days after your offer was submitted, as Keith noted below, the culprit will probably be the bank itself. For the larger national banks with many "layers" of departments working with one property, often the loss mitigation department (the group that reviews and, ultimately, (hopefully) accepts short sale offers) and the foreclosure department are not "talking" to one another. While loss mitigation may be aware of the short sale, it has not progressed enough through the bank's "system" to alert the foreclosure department and, thus, the foreclosure department sets up a Trustee Sale and the home is sold before a short sale has even been reviewed. I've heard of this happening more often than I would care to repeat and it is why the listing agent's role in a short sale is so pivotal to the successful outcome of the short sale.
As for your particular situation, it certainly may have been that the short sale was started too late in the process to stop the foreclosure. Also, please remember that the listing price is one that is set by the sellers, and NOT the bank. As a result, while your offer may have been close to the listing price, the real issue is how close was your offer to the "appraised" price of the home or the price generated by a BPO (broker price option)? If the price you offered was significantly less than the BPO/Appraisal price, the bank may simply have opted to foreclose on the home, collect any mortgage insurance money, wipe out any second or third lenders, and resell the property at a later date. There are many extenuating circumstances that dictate what happens to a home that is being sold in a short sale.
I am so sorry to hear that the home was foreclosed, but, rest assured, there are other homes, and probably one that will be better than this one in the near future. Good luck!!
Area Pro Realty