I'm so sorry! That really sucks!
Just before we got married we were supposed to close on a house that we had started to feel was meant to be our home. Less than a week before closing, the seller's backed out! Honestly, it was the best thing that could've happened - though there was no way I would've believed it at the time. After a lot of frustrating and demoralizing 'shopping' trips, we found our dream home, and we're closing on Monday! The house is so much better than the first one was, and because we had a few more months to save, we're in a much better financial position.
Try to stay positive. The right house is out there, and when you find it, it'll all be smooth sailing. Until that point, have a glass of wine and try to forget about it.