There’s something valuable about anyone, especially kids, seeing someone like themselves in heroic or powerful positions in both fiction and real life. It shows that it’s possible. That the naysayers are wrong. That it’s okay to dream.
I’ve related to female characters, and characters who weren’t like me in other ways, just as I’m sure women have related to male characters. With the best storytelling, any audience member can project themselves into any character. But at a subconscious level, it happens more naturally, and perhaps more completely, when the character is more closely like you.