It is good and okay to sleep without underwear as a male.
Although there's no health benefit from sleeping without underwear but it helps you air out though.
I sleep without underwear and sometimes sleep in just my shorts or pajamas.
I wear underwear sometimes but not all the time.
In the summer I don't wear underwear because they get too sweaty for me and lead to rashes.
So I leave the underwear off when it's summertime.
But in the winter I wear them to provide some extra warmth.
Underwear is meant to protect your outwear such as shorts or pants from secretions from your body.
Underwear is worn for a variety of reasons.
They keep outer garments from being soiled by perspiration, urine, semen, pre-seminal fluid, feces, vaginal discharge, and menstrual blood.
Women's brassieres provide support for the breasts, and men's briefs serve the same function for the male genitalia.