When I was young, living at my parents' home, we were expected to wear pajamas, because us kids shared bedrooms and bathrooms.
When I moved away from their home, I chose to sleep in the nude, and was more comfortable with that. But, once I turned 30 years old, or so, my body started changing, and I found that I would sweat a lot at night, especially when the weather was very warm or hot.
As climate change has affected my region a lot, every year now, spring, summer and autumns have become much warmer here. With that, I sweat a lot more when sleeping, especially my balls and groin area. So, I now need to wear underwear when sleeping so that I don't soak my bed sheets with sweat.