I just want to give you kudus for owning up to what happened. I doubt many people here are going to say I told you so, life is for learning. I still say it is hard to make good choices when you are sleep deprived. I try to not make decisions when I'm in that state because past experience has shown me that I can sometimes make really bad decisions when sleep deprived.
Like zinco said, don't let shame get you. Just add this experience to the big book of learning experiences, and take actions now to find different ways to handle this situation the next time. There is a ton of stuff to find out about sleep problems and there is sure to be something out there that will work for you. Unfortunately sleep problems are a part of depression and will likely happen again.