an ending has to be satisfying; that hardly means happy, but its just harder to make a sad ending not make you fill cheated.
red dead redemption was depressing as hell, but as im sure everyone everywhere has pointed out, it was also a good/great ending, because it had closure, made sense, and was relevant to the theme of the game. ultimately every story is supposed to evoke some kind of feeling from the reader/watcher/player, and sadness is very much a feeling. if a story has evoked actual emotion from you, there is something about the human brain that makes you like it no matter if that emotion is happy, angry, or sad.
but sad endings are just inherently harder to do and riskier. with a happy ending, even if its stupid you can at least enjoy everything preceding the ending, but a bad unhappy ending leaves you feeling like the whole story was pointless and amounted to nothing.