Most of the female Starfleet crewmen on the original Star Trek wore very short minidresses. This was not Gene Roddenberry's original plan. But the network axed the professional, non-titillating uniforms that the female crewmen on the first pilot episode wore, along with the female first officer.
As a generation grew up watching Star Trek and its depicted gender roles, some critics called for greater equity when the franchise was developing The Next Generation in the mid-80s. One of the results was that, for a few episodes, a couple male background characters wore minidresses. Nigel Mitchell, About.com's Star Trek expert*, traces the lengthy history of the Star Trek miniskirt:
When people began to complain, the Trek community's response was, "Nuh-uh! The mini-skirts weren't sexist! Because, uh, men wore them, too! It was unisex!" This seems to have been most clearly stated in 1995's The Art of Star Trek. In it, the book says "the skirt design for men 'skant' [a combination of "skirt and pant"] was a logical development, given the total equality of the sexes presumed to exist in the 24th century."
Of course, this is easier said than done. The next question would always be, "So where were all the men in mini-skirts on the original series?" The answer would be that there were some, but you just didn't see them, which left uncomfortable stares and raised eyebrows. That gap is what Star Trek: The Next Generation tried to fill.
When the pilot episode "Encounter at Farpoint" aired in 1987, the "skant" is worn by both Deanna Troi and Tasha Yar (briefly). But we also get our first glimpse of the male skant in the background in this episode. Overall, the men wearing skants appeared in five episodes of the first season ("Encounter at Farpoint", "Haven", "Conspiracy", "Where No One Has Gone Before" and "11001001"). They also appeared in second season episodes "The Child", "The Outrageous Okona", "The Schizoid Man", and "Samaritan Snare." Their final appearance came during flashbacks in the series finale "All Good Things..."
*And Nigel really does know his stuff. I saw that clearly a while back when he and I were brainstorming ideas for a Worf sitcom.