Some actors are more prone to dying than others. It's not directly related to their identity, but rather the typical role that they get cast in. There have been some good examples of actors who have died more than Sean Bean, but the explanation is relatively simple for most of them: they play villains, and villains are narratively prone to dying.
Tim Curry, Alan Rickman, Christopher Lee, ... These actors are so delightful at playing a villain, that they are logically more prone to playing the bad guy. Statistically, they will end up losing the plot more often than any actor who does not get typecast as a villain.
But it's slightly different for Sean Bean. The two big roles where he dies (Boromir and Ned Stark) were both honorable men.
Sean's general role is somewhat easy to recognize. Principled (although sometimes he is on the wrong end of the spectrum, his characters generally believe they are on the right side of things), wise, lives by a code, usually does not act recklessly, and he generally tries to instill his code in the people he cares about (with a hint of feeling like he's superior, but in a generally kind way).
There are many reasons why such a character is likely to die:
- The teacher (who already masters the lesson) generally gets to teach the lesson, but then dies so the student is forced to apply the lesson correctly.
- The man who does not act reckless will die if the plot heavily favors a strategic approach. Because he'd inevitably win the plot.
- The kind man dies because he doesn't deserve to die.
- The man who lives by a code, will die because his code is used against him. It is then up to his closest friend, who is now afraid to apply the code, to improve the code and live by that new code.
These are all relatively common plot devices. And Sean Bean manages to tick all of these boxes with the general roles he gets cast in.
When Boromir and Ned Stark show their strong sense of honor and duty, they paint themselves as an innate good guy. This is almost the exact narrative equivalent of showing your family pictures to your fellow soldiers (and it's a common trope that these characters tend to always end up dying to create some drama).
And creating drama is exactly why these characters often die.
- The man who didn't want to fight in a war and was only thinking about peacefully going home to his family doesn't get to go home. And he wasn't even capable of hurting a fly.
- The man who never wronged anyone and only wanted everyone to have their fair share is destroyed by those who want it all.
That's unfair. It creates drama for the character's friends, it paints the plot as harsh and unforgiving.
This is why Ned Stark dies. Morally, he was superior to pretty much everyone else. If Ned Stark had taken the throne, so much of the turmoil of the subsequent seasons would simply not have occurred.
His death had the viewer screaming at the screen, much like how Obi-Wan stood there screaming at Anakin. He was supposed to be the chosen one, the one to show us the path.
At face value, Boromir is different, because he tried to take the Ring from Frodo. But when you look at Boromir as a person, the image changes. Just like how we consider Sméagol good and Gollum bad, we should consider the Boromir that tried to take the Ring (Gollum) as a different person from who Boromir used to be before the Ring corrupted him (Sméagol).
Boromir talks at length about how his people have suffered because they are right next to Mordor. They are dying constantly, just so they can keep everyone else safe.
This put Boromir in a similar spot as the soldier who shows family pictures and doesn't really want to fight a war. Boromir is stuck in a war with the Orcs due to geographically being close to them, and wants to get out of the war. Not because he wishes to claim something for himself, but because he doesn't want to lose what he has.
A non-aggressive, honor-bound man, who doesn't take from others and merely wishes to preserve the things he loves. He suffers continual hardship, yet remains level-headed. And he ends up corrupted by Sauron, temporarily turning him into what he has never let himself become (jealous, greedy, aggressive).
Boromir wasn't (narratively) killed by the arrows. He was killed by being corrupted. A good man, arguably the best of the fellowship (due to suffering such hardness yet still taking it in stride), brought to his knees.
In this way, Boromir is no different from Ned Stark. Their deaths are so wrong that they put fuel to the fire of the good guys.