I think it is universally understood that you should go to sleep with clean teeth but we don’t always follow the rules (even me). Whether it is finals week, and you are overwhelmed with studying, or you are just so exhausted from the day, we all are probably guilty of forgetting to brush or of having a snack before bed without brushing at least once in our lives. Whatever the excuse, dirtying up your teeth and then going to bed is not how you maintain a healthy mouth.
Your mouth is not a sterile environment (and it shouldn't be). The purpose of brushing is to refresh and turnover microbes on the surfaces of your teeth to prevent stagnant masses of unhealthy plaque from developing as well as deliver fluoride via toothpaste to strengthen teeth. Even after brushing, there are still reduced numbers of bacteria on the surfaces of your teeth. From the minute you are done brushing, bacterial plaques begin to regrow and mature based on the available bacteria in the mouth and other factors. If you forget to brush your teeth altogether before bed, you’re allowing bacterial plaques to mature undisturbed overnight, which favors colonization of acid producing bacteria.
Now, if you decide to have a late night snack without brushing, this will compound latent bacterial development. Any time there is available food, bacterial communities undergo growth spurts, and depending on the the type of food or drink (specifically the sugar content) the growth of some bacteria is favored over others. If you have food (or a drink with a bacterial food source i.e. sugar) after brushing at night, this will alter how bacterial biofilms reestablish themselves while you sleep – likely in an unhealthy way, with more acid producing bacteria. Additionally, while you sleep salivary flow is reduced and any bacterial metabolites produced from the food you ate after brushing will not be cleared as effectively and will hang around to cause problems longer.
Night time is also an important period of rest and recovery for your teeth when they will remineralize from the wear and tear of the day. Disrupting this natural cycle with food is not good for your teeth. Furthermore, by not brushing (or rinsing with a fluoridated mouthwash) right before bed, fluoride will be unavailable to aid remineralization and you will limit the extent of potential recovery.
The bottom line is that forgetting to brush your teeth at night and especially eating before bed will reduce natural reparative mechanisms and lead to the development an unhealthier oral environment. Avoid it. That said, brushing your teeth before going to bed does not make your morning oral hygiene routine and less important. Brushing your teeth before breakfast in the morning is as important (and probably more important) to the health of your teeth.