My kids watch a show where there the characters are superheroes, and they have to keep their identities secret from one another. For reasons. Do those reasons make sense? Not really. But it’s the way the genre works and always has. It’s just a superhero thing. And sometimes, that makes sense; there’s the idea that villains will go after a hero’s loved ones in order to get at the hero, and we do see that happen—but it’s not necessarily sensible beyond that.
I mean, for one thing, Lois Lane has been a villain magnet for nearly a century, and that hasn’t been any different when she didn’t know that Clark Kent was Superman. For some reason, another trope of the superhero genre is that the superhero’s loved ones attract plot anyway, and it’s never considered that they might actually be safer if they were able to summon the superhero who has a vested interest in protecting them. Or that some sort of special protection might be in place to let their loved one go about their superheroing without worrying about them.
I think in more modern versions, the answer is “because it’s always been this way.” But originally, the reason was that the person didn’t have superpowers, and they were doing things in their secret identity that they couldn’t do as themselves. More like spies than anything else. That’s what the Scarlet Pimpernel was doing—if the French government had known who the Scarlet Pimpernel was, they would have prevented him from saving the lives of aristos, probably by killing him. If his various foes had known who Zorro was, he could’ve ended up in jail or worse.
And, let’s be real, superheroes have traditionally been vigilantes. That just is what it is; it’s the nature of the genre, for the most part. Which has its own problems. But it does mean that there are routinely forces theoretically on their own side who want to arrest them for, you know, running around and beating people up or what have you. So I suppose that’s another reason for keeping a secret identity. However, it doesn’t work in every story.
The problem is that the trope goes beyond that, in almost every particular. And sometimes, you can track it back to something that made sense in its original variation—the Scarlet Pimpernel kept his secret from his wife because, for reasons, he couldn’t trust her with it. As soon as he knew he could, he told her. But these days, you end with superheroes keeping their secrets from loved ones well after there’s a reason for it, because that’s what the Scarlet Pimpernel did.
There are reasons to keep the trope; it is, after all, what everyone expects. But I do like that the MCU is kind of dabbling in the “no one really cares” pool and has been since its outset. Yes, Peter Parker is still keeping his secret, but Tony Stark ended his first movie by declaring himself to be Iron Man. We’re still stuck with origin stories for now, but at least there are some tropes that we’re willing to start reconsidering.