I will give you a "male perspective" on this because, well, that's what I am :)
The bottom line is that men don't know any better.
You are probably fully aware that, as individuals, we tend to stick around our own. This means many things, but the most important is that we learn to recognize the signs from the people who are like us.
When it comes to business, of course, men are fare more capable at recognizing male talent than female one because we have a tendency to stick around men more than women, even though that seems counter-intuitive.
The other problem is that women know that, so they will not usually make themselves available for a promotion because they know they would probably be passed up by men.
And, finally, there's the defining issue of our time: the Dunning-Krugher effect. Dunning and Krugher found out that people who lack visibility of their limits tend to be over-confident and that means that, sometimes, a mediocre employee gets promoted because of the confident air he exudes.
Misogyny also plays a role but a far lesser one that people would normally think: you see, misogyny is a thing only if you're able to recognise the talent around you and that's seldom the case.