I've never understood the purpose of it. It makes the heroes unable/unwilling to explain the situation to their loved ones. Thus they ultimately create rifts with their loved ones. Like, I understand why it's done (drama), but I never understood the actual implications of a secret identity. It does more harm than good. So I'm asking, why would a superhero, in the modern day, want a secret identity?
Firstly, if you know the hero's real identity, you as a person would act differently around them. Who would want to hire and boss around Superman when he is literally invincible? It would make it incredibly hard for the superhero to live a normal life and they would be chased around by paparazzi and fans forever.
Secondly, if a villain knew the hero's identity, they would be able to better plan around situations the hero would have to face and also influence the hero's life. Heroes don't exactly go around arresting people who have not committed a crime yet, so knowing who the hero is allows a villain to either plan around their daily life, or launch a preemptive attack, neither of which would be preferable to a hero.
Thirdly, if the villain knew who your loved ones are, they would have an advantage over you should they kidnap them. Keeping your identity a secret protects them from likely harm and also doesn't burden them with the social pressure of dating a hero, being friends with one, raising one, etc. and the endless stream of questions, jealousy and gossip they would probably face from fans around the world. Even if they are kidnapped, it would be random chance with the hero's identity a secret, rather than intentionally and this gives the hero more power to pressure the villain to comply with her/him.
A secret identity allows the hero to live a normal life - they might not want to be a hero all the time, they might want their own time, or to relax. They want to protect those they love and those close to them, and they want to have an edge against the bad guys. Not everyone is okay with effectively exposing their entire lives to the world and its criticism.
Because your loved ones are a liability you don't want to expose
Let's just use Superman as a classic example. How do you attack Superman? You can't. He's super strong, can fly, and shoots heat lasers out of his eyes. Generally speaking, you don't want to attack him, or do anything that's going to annoy him.
Lois Lane; whole different story. If the world knows that Superman is Clark Kent and that he's in love with Lois... Scratch that. Even if they don't know he's Clark - what if all they know is that he has a thing for Lois?
That's his Achilles' Heel. That's the thing that will get him do do anything to save her and he's ultimately under your control as long as you hold her in a prison surrounded by Kryptonite or whatever. The point being that you really don't want people knowing who you care about.
While not on the same scale, this already happens in the real world. Spies (for example) don't share their lives with their loved ones, even if they really want to know. First of all they can't, second of all they won't be able to handle the really tough stuff. Many emergency workers feel the same way. What if you (as a superhero) only just managed to protect the Earth from some Asteroid / Zombie Apocalypse / Insert your trope and it was a closely run thing? You really don't want to dump that on your significant other, and they (as much as they'll tell you otherwise) don't really want or need to know how close the world came to destruction. Again.
So; they keep the secret from the world for the same reason that policemen don't put their home addresses up on facebook, or public superstars don't get listed in the phone book. They keep it from their significant others because seriously, their relationships will last longer that way.
Besides; this is the era of marriage breakups. Do you really want Lois spilling her guts in a tell-all interview with Entertainment Tonight about Superman as a negotiation tactic for keeping custody of the kids? No. You don't. Modern intelligence workers face similar problems already and face a choice; either quit the industry or risk losing their kids. It's a stark reality and not an easy decision to make for many.
Take that to the next level and you have a superhero who can't quit the industry easily, and you know it's going to be a solitary existence. Your family cannot know (if not for the reasons above) simply because the more people who know, the greater the risk of exposure. The greater the risk of exposure, the more likely someone eventually takes someone you love in an effort to control you.
If you're a super hero and not a super villain, you'll do anything you can to avoid that contingency, even risk losing the people you love to protect them.
It's to do with the mechanics of narratives in English, the rules of what makes lead characters suitable to be the focus of the story.
At its core, narratives in English have their roots in a period when people couldn't read, yet plays illustrating the bible were enormously popular. These spectacles slowly evolved into theatre plays about non religious topics but they kept the core of allegory (and also why the puritans were so dead against popular theatre). So it's from these "Mystery plays" as they were called, we get the expectations that a story must be about Good vs Evil, that the lead character must show certain traits - self sacrifice, humility etc., that good acts get rewarded while bad acts get punished. And people expect any story to be structured around these core rules from film to novels to wrestling matches to superhero hero comics.
Thus it's humility that has the hero hide his true identity because only Villians will do the opposite.
Heroes never act out of pride, or wrath, any beatings they give to villains are not their conscious choice but part of their role as the instrument by which the villain is punished by God for being evil.
Heroes may be rich, but not because they actively seek wealth as that would be gluttony or avarice.
And so on.
Super heroes have super villains.
Either you have no friends or family or you put them at risk every time someone wants payback.
A lot of heroes do tell their family but two people can keep a secret if one of them is dead.
The less people that know, the less likely someone will let it slip out and then the family has to go into the super hero version of witness protection.
I have often thought that many, though not all superheroes, don't need to live in their birth identities and shouldn't.
A superhero without families and friends could live in a fortresss of solitude at the north pole or in outer space and only come down to Earth on superhero missions.
And if the superhero gains a family they could move in to his fortress and make it a fortress of family life, unknown to super villains.
Or maybe there could be a superhero town or city where superheroes live, so a superhero could go out into the outside world to save people knowing that other superheroes are guarding the town to protect all the non super loved ones of superheroes.
So I think that many superheroes could live in their superhero identities 24 hours a day, and occasionally take on the identities they were born with to mingle with ordinary mortals and visit friends and relatives who don't know they are superheroes.
Superheroes might create dummy businesses that officially employ the birth identities of those superheroes, so they can claim that they have jobs.
No doubt many superheroes have situations where such a plan wouldn't make sense, but I think it would work for many superheroes.
So one reason that has been another consistent reason for Secret Identities that I haven't seen is that many Superheroes... even single and no family heroes have is that they are engaged in what is predominantly a criminal act. Most Superheroes are vigilantes and while many may uphold the law just as well as any deputized officer of the law, some do not. Batman, for example, skirts the line of hero and vigilante depending on the writer. Watchmen and Increadibles both explicitly state that superheroic activities were tantamount to vigilantism. The Marvel Universe is rather insane with the Punisher, X-Men, and the Hulk having different shades of Vigilante style legal issues before Civil War. And the less we say about Spider-Man... who sells his selfies to the Daily Bugle which considers him either a threat or a menace or both, the better. Dude needs a Super-PR agent.
It should be noted that in the United States (and other common law jurisdictions and possibly some Civil Law jurisdictions) do have Citizen's Arrest, which allows an ordinary citizen (even one wearing a mask) to arrest a person committing a crime in their presence without a warrant. However, the liability for these actions is much stricter if they get it wrong than a deputy of the law. The crimes permitted depend on the State in the U.S.
The idea of a superhero breaking vigilante laws has been frequently discussed in various fiction as yet another reason to wear a mask.