This is ultimately the question, isn't it?
What is
Star Trek? What are its fundamental creative conceits? Is
Star Trek supposed to be escapism or realism?
It's a hard question to answer, because as a franchise, ST has done variations on so many genres that it can be hard to say sometimes. It's done tragedy and comedy and everything in between.
More fundamentally, though, this also points to the question of just what we mean when we talk about Realism.
Realism/Natural, if we look at the history of the theatre, was a set of conventions that developed in the late 19th Century based around the idea of accurately re-creating both the environment and the psychologies of characters. Instead of plays like
Everyman, with a title character whose psychology is unrealistic, we begin to see characters like Hedda Gabler, who are designed to re-create the complex psychologies of real people. Instead of representative sets, we would see complex sets designed to re-create real life in as exact detail as possible. It is from the theatre's Realism/Naturalism movements that modern film and television developed most of their creative conceits.
But it's important to remember that Realism/Naturalism, though they coincide, are not identical. Realism is based on the idea of psychologically believable characters; Naturalism is based on the idea of accurately re-creating the environment instead of using representative settings.
Star Trek clearly does not embrace Naturalism. There are no faster-than-light starships, no space stations beyond Earth orbit, no alien lifeforms who happen to look just like humans except with pointy ears.
But
Star Trek has always embraced Realism, at least insofar as the conventions of television and film at any given moment of its production allowed. For all that Captain Kirk has the popular image of a two-dimensional 60s ladies man/action hero, he was actually a very dedicated officer who struggled with loneliness; Spock, of course, infamously struggled with his self-identity. Sisko was a single dad mourning his wife, considering leaving Starfleet. Etc. The characters have always had vivid emotional lives, even when they had green blood. Sure, not as Realistic as we might see on a premium channel -- ST has always had to conform to the conventions of American broadcast television. But within those confines,
Star Trek has always embraced Realism.
Yet it hasn't always held onto Realism in every single story. ST is full of silly escapist stories. Many of them are quite wonderful -- "The Trouble With Tribbles," for instance, or "Author, Author" -- even if they did not necessarily always have the characters behaving in completely psychologically Realistic ways. That's part of the confusion, I suppose -- because ST has on occasion deviated from the Realism that has generally defined it, there's an impulse to combine that deviation with its general rejection of Naturalism to argue that ST is un-Realistic.
On another level, then, we find the question: Is optimism Realistic?
Is
Star Trek's vision of hope for the future a vision that's incompatible with a strict adherence to Realism?
A compelling case can probably be made that it is. Certainly, if we look at some of the most critically-acclaimed television programs of recent years --
Six Feet Under or
The Sopranos, for instance -- we can probably make a strong argument that a commitment to Realism in characterization and plotting requires an acceptance that the world will always be very unpleasant and messed up and that hope for the future is fleeting at best.
But a compelling case can be made for the opposite. If we look at, for instance, Aaron Sorkin's
The West Wing, we find a series with an absolute commitment to Realism/Naturalism -- and an absolute commitment to the idea of optimism for the future, of true idealism. That even though people are messed up, they can overcome it.
Star Trek has certainly, at times, been about escapism. No one can watch "The Trouble With Tribbles" or "Q-Pid" or "In the Cards" and think that they weren't trying to have fun first and foremost. But by the same token, those episodes, again, are deviations. Most episode of ST have been Realistic in the psychological sense. TOS's definitive episode had Kirk having to sacrifice a woman he had come to love to save the future; TNG saw Picard getting into a fistfight with his brother while recovering from, essentially, having been raped; DS9's first episode saw Sisko forced to confront the death of his wife; VOY was all about people stranded far from home, trying to return. ST has always featured tragedy even as it insisted that tragedy does not define our lives.
So to say that
Star Trek should not, in principle, feature plot developments that are upsetting because it's supposed to be escapism and not Realistic -- that's just not a valid argument. At all. It means ignoring the vast preponderance of ST episodes and films.
If Janeway's death didn't work for you, well, hey, it didn't work for you. That's subjective and a perfectly valid statement. But to say that
Star Trek should on general principle never feature beloved characters' deaths? That's just hogwash.