"There was a time" this was true of every Christian denomination. I knew a Catholic family that wouldn't allow their daughters to wear pants, even to school, because they saw it as a matter of their faith.
Baptists may have held on longer to a dress code for women, that I'm not sure of, but if so that would be all there is to it.
When I was first visiting churches to determine which church I might like to attend after I was saved, I attended many churches and more than one denomination and I ran into one church where all the women were wearing near identical potato sacks (shapeless, formless dresses), so similar it seemed quite uniform-like, but they weren't Baptist, it was some independent church of some kind.
In my area there aren't even independent Baptist churches where I would feel uncomfortable wearing pants. The Primitive Baptist women all largely wear dresses to church but not like a uniform or something, and not even they would look at me funny if I wore slacks nor make me feel uncomfortable or out of place.