+1 to @JoelW.; the point that they answer two different questions is dead on. I'd also like to suggest that you assess more than just the median. The distributions are almost certainly going to differ in more than just their central tendency, so a fuller understanding will require understanding the whole distribution. For example, I wouldn't be surprised if the gap at the 90th percentile is much larger than the gap at the median.
In teaching / discussing statistics, we often say that you should bring your theoretical knowledge to bear, but what that really means in context may not always be clear. I think this affords an opportunity to unpack at least one possible meaning of that, so I'll do so here. You need to have a model of what's going on when you attempt to analyze your data. Intuitively, it would seem that we could just get some good data, look at it, and that would tell you what's going on (at least, I have those intuitions), but unfortunately, that isn't really true. With these things in mind, lets think about this topic and the two different answers you're getting.
The most basic way to assess the pay gap is to use option #1. However, it's often pointed out that men and women tend to make different choices and that we should take these choices into account when assessing the pay gap. For instance, a higher percentage of women than men may choose to go into fields that tend to be lower paying. That suggests that option #2 is more appropriate. However (and importantly), this assumes a model of what's going on; among other things, it assumes the pay rates for different careers relative to each other are fairly stable over time, or at least changes are largely unrelated to the dynamic under investigation. (It also assumes that you want an estimate of discrimination.) But we can push on that assumption a little bit: as women have entered the workforce more fully over the last generation or two, the sex composition of different professions has changed, and the mean pay for various professions relative to each other has changed as well. If women were simply being paid less for equal work without regard for other factors, then as more women went into a given field, the average pay in that field would go down, and it might look like women were being paid less because they chose to enter lower paying fields. Thus, under this model, option #1 becomes better again.
All of these stories entail strong assumptions about what is going on. It may well be possible to gather other data to test the assumptions underlying these different theories, but those investigations would entail (other) assumptions as well. It simply isn't possible for a set of data to pick out the true account without entailing any theoretical assumptions about what's going on. Hopefully, this discussion provides some fodder for thinking through which you want to use, in accordance with @JoelW.'s suggestion.
(For the record, these are just stories I made up for illustrative purposes. I'm agnostic about which is right, and I have zero interest in getting into a political discussion in this forum.)