The problem is people are unclear about what they are talking about.
There is: a gap in average pay based on the fact that there are more women working part time at certain ages due to caring responsibilities. Many people think this is a sign of structural sexism, many people think it's a choice.
There is also a gap in average pay due to there being more women at management levels. Many people think this is because more women are part time, or aren't as competitive, etc etc, but on the whole it applies regardless of experience and is based on perceptions that are still deeply ingrained that men are better managers.
There is also a gap in what men and women are paid for doing the same job, and the same hours. This is less common in some jobs because of the way things are structured, but still exists, and is particularly apparent in situations where people negotiate salaries and are discouraged from talking about what they earn. Some people still justify this by saying women don't negotiate as well as men- but years ago I read an amazing study by McKinsey, who tracked young graduates and classified them by their career style. So, one group were negotiators who were quite aggressive in trying to advance, one didn't do anything proactive but just applied for jobs as they came up, one tried 'soft' approaches like networking, getting mentored etc. They found men who took 'aggressive' approaches did best, but women who tried the same did poorly as people didn't like that from women. Women who networked did best among women, but about the same as men who didn't do anything proactive.
The problem is, we tend to talk about the gender gap without specifying which aspect of it.
It all speaks to structural inequality and discrimination on the basis of sex throughout society, but at the moment it's easier for people to dismiss it as stemming from choice because of how it's discussed.