Not us, but some of us who are tormented by guilt.
When I remember unpleasant moments about myself, I am indignant, analyze and laugh at my own irrationality, so I don’t waste time on these actions, but they do not torment me before bed.
Why mock yourself by constantly remembering the past that you cannot change? The act has already been committed, the feeling of guilt has worn out, so analyze the situation, say thank you for a very unpleasant lesson and let it go with a clear understanding that henceforth you will first think about how the action will end, and then do it.
Because your mind at that moment is not busy with anything, but you still need to occupy your thoughts with something. And apparently your brain thus protects you from current problems that are probably much more serious than problems from the past. You can re-experience these shameful moments still bring less stress than if you were thinking about your current problems. To admit, I myself remember my shameful moments every day, but not only before going to bed, but also when I sit on the clean and jerk)
Read the scripture of the great sage Osho, oddly enough he answers so many questions, there are many videos on YouTube. I’ll answer you simply - our brain cannot go into a state of calmness and is raging, from that, and thoughts at night can creep into our head chaotic, including negative ones.