The primary function of underwear is utilitarian. Underwear keeps us warm, keeps away the bodily fluids from the outerwear and protects the body from the maybe coarse material of the upper garments. Underwear also has an erotic function but there were stages in its development when underwear was less than sexy.
Not sexy undergarments of the 1930’s.
Youg or old, they do not look attractive at all.
Women, on the other hand, look sexy whatever they wear.
Bonus Pictures from Much Eariler Age