At night, generally, saliva flow reduces up to 10 times than during the day. Since saliva carries factors which balances the pH in your mouth, a significant lack of this will allow more bacteria to grow and also create a more acidic environment than during the day. If any mouth breathing occurs either in episodes or constantly, it will worsen the situation further.
Now you know why you may have bad breath in the morning.
Brushing and flossing thoroughly at night before going to bed significantly helps reduce bacterial growth over night which can improve bad breath and help prevent dental diseases. And don't forget to gently brush your tongue in the morning!