Also, does the reverse ever happen? I can't seem to think of any.
Madison was originally a surname and remains fairly rare for boys in the US per the Social Security Administration. It's become popular--literally pop-science: Freakonomics and The Stuff of Thought mention this--to link the rise in girl Madisons with the 1984 movie Splash, in which Daryl Hannah plays a mermaid come to New York who picks her name off a Madison Avenue street sign. Tom Hanks protests "Madison isn't a name!" Before 1985, it was almost unheard of, and by the 2000s it became a top-ten name. So seems a plausible link to me.
I answered a very similar question yesterday about naming conventions, which you might like.
For naming trends, Wolfram Alpha is a great tool! So I plugged those names in as "male given name" and "female given name".
Here they are graphed against each other.
With Tracy, as you can see it was very rare until the 1950s for either gender, and its rise seems to have been starting around the same time for both, although much more popular as a woman's name.
Kelly was more popular as a man's name, but not by all that much, until very suddenly eclipsed as a girl's name in the mid-1950s as well.
The rise of Madison seems to have been in the 1980s, and almost exclusively as a woman's name, although it seems to have seen some use in the 1800s as a man's name, but not very popular, and totally dead by the middle of the 20th century.
Obviously that only answers half the question. The why, I'm not good with, but this gives you a sense of when the various changes happened, and I would encourage you to play around with Woflram Alpha some more and see other names.
The data there isn't just the graph, but will give you rankings, average age, and such. For instance, Madison originally means "Son of Maud".
You might consider cross-posting this on /r/linguistics where someone may have some expertise.
Mod note: Guys, please stop sharing just examples of this phenomenon, these have all been wiped. We need analysis with the examples!
There is a pattern with English names (that is, personal names of any origin as used by English first-language speakers) that female names are more likely to end with a vowel phoneme and are more likely to feature short vowels, whereas male names are more likely to end with a constonant phoneme and are more likely to feature long vowels. Research has suggested that there is an onomatopoeic basis for this, because as English speakers we associate certain sounds as being more feminine and contrasting ones as being more masculine, there's also the input of the romance languages, particularly Latin and French where a final vowel is often used to distinguish a female name from its male equivalent.
We can see this pattern when we compare pairs and groups (note these are grouped for sound similarities rather than etymological relatedness, some share roots but others just coincidentally share sound patterns) such as
George and Georgina
Christopher, Christian and Christine
Paul, Paula and Paulina
Ryan and Rhian and Rihanna
Alexander and Alexandra and Alexandria
Victor and Victoria
Daniel and Daniella
Peter and Petra
Dorian and Dorothea
Albert and Alberta
Most people, if they had never heard the names 'Kelly, Hillary, Leslie or Tracy' before and they had to judge whether they were male or female based on a familiarity with other English names would predict that they would be female.
I'm putting Madison aside because its features are more neutral, Madison like 'Robin' fits easily in to either camp having both long and short vowels and a stress that falls before the final constant containing syllable rather than directly on it. Indeed you can alter the stress patterns of these names to make them sound more or less feminine.
Parents often like to be creative with names and more so with girls' names than with boys', which tend to be more conservative, so it's natural that over time people will adapt a male name that sounds feminine to them for their daughters. The conservative nature of boys names isn't just based on gender rigidity - parents are also much less likely to seek originality with a boys name, there is a greater concern that boys will be targeted for bullying if their name stands out.
There is a related phenomenon with distinguishing grown up names and childhood or familiar nicknames for boys and men. Male nicknames are often more feminine sounding versions - with those shorter vowels and final vowels, compare Robert and Robbie or Bobby, William with Billy, Harold with Harry, Jimmy with James, Danny with Daniel and so forth.
There are numerous exceptions to these rules, because the names we use are so varied and multi-cultural and many people make an effort to go against the grain, but they are pervasive enough to subtly influence naming choices and on a population wide scale that can have the effect, over many years, of reversing the established gender norms of a name.
Serious question: how do you know they were male names first? Couldn't they have been female names turned male names?