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). Sometimes, life's chores and responsibilities get in the way and I think most of us can admit to going to be bed without brushing or noshing on a late night snack before retiring. But whatever the excuse--dirtying up your teeth and then going to bed is not how you maintain a healthy mouth.
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. 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 encourage bacterial development. Any time there is available food, bacterial communities undergo growth spurts, and depending on the type of food or drink (specifically the sugar content) the growth of some bacteria is favored over others. Additionally, while you sleep salivary flow is reduced and any bacteria 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 of an unhealthy oral environment.
That said, brushing your teeth before going to bed does not make your morning oral hygiene routine any less important.