
Franklin D Roosevelt in 1884, aged 2 / image via Wikipedia
In those days it was simply a matter of style. It had nothing to do with recognizing or condoning gayness/trans-ness/etc.
It was fairly common in those days to have small boys wear dresses until they were potty-trained. It was easier for the mothers (or nannies) to slip on a dress as pants at the time were fairly complicated to take off and put on. Such things as zippers and snap buttons weren't invented yet. So they had to "earn their britches" by learning how to use the toilet properly and dress themselves.
Still, FDR's mom or more likely nanny went a little overboard on the femininity. Mary Janes, floppy hat and long girly tresses? Yikes.