It's OK to feel down and out when you fail, but Brad Feld on his weblog recommends giving yourself only a set amount of time to wallow, and no more.
In his post about failure, Feld talks about Jeremy Bloom, the CEO of Integrate and a former Olympic skier:
In 2006 at the Winter Olympics, he was the best freestyle mogul skier in the world. On his last run, he was expected to take gold. Halfway down he missed a turn and placed sixth. As Jeremy told me, he gave himself 24 hours to be angry, depressed, upset, furious, frustrated, confused, and despondent. I imagine him in his room in the Olympic Village systematically destroying all the furniture. One minute after 24 hours, he was on to the next thing, with the failure solidly in his rear view mirror.
If 24 hours is too short for you, come up with a time that feels right. It's ok to be upset and let it all out! Failure makes you stronger, so once it's all out of your system, it's time to move on to the next one.