My Dr explained to me that proper sleep is important for the body to "reset" chemical balances and metabolism. It is still calories in vs out, but you are more likely to store the calories than burn them due to the "metabolic system" being out of whack due to poor sleep.
Personally, when I have not slept well and need to be productive in a day, I’m much more likely to want to load up on sugar and unhealthy food