According to some new research by Todd Maddox at U of Texas, sleep deprivation makes the thinky part of your brain, the frontal cortex, get all sucky.
Yeah, we all knew that, right? But what we didn't know is that it doesn't really affect the instinct-y part of your brain, the striatum. Which is why, for example, you're still OK at doing routine tasks (take out the milk, take out the cereal, take out the bowl, put food in face), but sometimes you'll muck up and do something wrong, but do it in the right way (put the milk away in the pantry, put the cereal away in the fridge).
And when you're really sleep deprived, you'll start consciously over-thinking things, which leans on the frontal cortex, which as you'll recall is all wonky from the sleep-dep, so you'll muck things up even more.
I will try to keep this in mind during grad school, and do everything by instinct. :)