Three of the main complaints I've heard about happy endings are that happy endings aren't realistic, a happy ending means the whole book is nothing more than fluff, and the story is boring if there isn't the possibility that one (or more) of the main characters could die.
1. Happy endings aren't realistic - this just isn't true. Yes, there are lots of bad outcomes in real life, but there are also lots of good outcomes. It's just that the bad ones get most of the attention. Also, I think it's destructive to believe that happy endings aren't realistic. If there are no such things as happy endings, then why should anyone even bother trying to make the world a better place or improve their own lives?
Now, I'll admit that a perfect happy ending, where everything is bunnies and rainbows and unicorns and no one ever faces any more problems or challenges for the rest of their lives, isn't realistic. Plus it would be boring. But, to me, a happy ending doesn't mean there aren't any problems still to be faced. True happiness comes in the face of challenges and trials. If you don't know what sorrow and hardship are like, then how can you truly appreciate happiness?
2. A happy ending means the book is lightweight fluff - this just isn't true, either. Like I said, happiness in more meaningful when you've had to come through trials and challenges. Therefore, my theory goes, the greater the problems the characters have to deal with, the happier the happy ending. I make my characters earn their happy endings. When you've followed the characters through a whole novel and all kinds of troubles and struggles and dangers, it feels even better to see them finally get their reward.
3. The story is boring without the possibility of the main character(s) dying - Life and death aren't the only possibilities in fiction, or in life. Actually, from a narrative standpoint, death is boring (unless the possibility exists for the character to continue developing and making a difference after death). To me, the questions of "HOW are they going to survive?" and "How are they going to live on in the aftermath of everything that's happened?" are far more interesting and filled with possibilities than "ARE they going to survive?"
The one criticism I've read of happy endings that I think is valid is that sometimes they seem to come out of nowhere and just be stuck on the end of the story without regard for plot, characters, world, or the expectations that have been set up in the story. But this is more a problem with the writer's craft than with happy endings themselves. You can also have tragic endings that come out of nowhere and are just stuck on the end of the story without regard for plot, characters, world, or expectations.
Part of the craft of structuring a story is laying down the seeds of the ending from the very beginning. So, for example, you can have something that looks like a deus ex machina (god on a machine, from old operas based on Greek/Roman mythology where at the end, when it looked like everything was lost, a god would suddenly swoop down from "heaven" on a piece of stage machinery and fix everything) and have it come out of nowhere and have nothing to do with the story, or you can carefully plant the possibility of divine intervention and what the characters have to do to earn or invoke it. Whether the god saves everyone or destroys everyone, it doesn't matter - the important thing is to build the foundation for it from the beginning of the story.
A lot of the "tacked-on" effect might also be due to the author's outlook on life. If an author doesn't believe happy endings are really possible but she feels obligated for marketing reasons to slap on a happy ending, it isn't going to be sincere. A writer should be true to their own vision, but maybe, I'd gently suggest, a writer whose worldview precludes any possibility of happy endings would benefit not only her stories but herself by expanding her worldview to include more positive possibilities.
Also, I suppose it's possible to write characters who don't naturally gravitate to a happy ending, so that they have to be forced into it, but I guess I don't write those kinds of characters. One of the common threads my characters have is that they want to take responsibility for their actions and be in charge of their own fate and be free to make their own decisions (even when they're in situations where they feel like they aren't in charge and don't have that freedom; they still long for it), and they want to use this freedom and responsibility to make something good of their lives. Again, this might have a lot to do with the author's own outlook on life. I believe in human freedom and agency and that no matter how bad things are, we always have the power to try, in some small way, to make something good of it, even if it's only in our refusal to give up hope or to let our trials make us into someone less than we are.
I've said before, since my books are partly romance, where Happily Ever After is a given of the genre, it's no spoiler to say that my books have happy endings. The questions isn't "Do they make it through?" but "How do they make it through?" and "How do they go on with the rest of their lives?" The characters have to endure a lot to get to that happy ending, and sometimes it isn't clear how things are going to work out, and there are always consequences from the events of the story - destroyed lands, consequences of their actions, lasting effects from the traumatic events of the story - to be dealt with in the future. The main thing is, they do make it, good overcomes evil and love triumphs over all, and my characters come to the end of the book facing the future and its challenges side by side and hand in hand. This is the payoff that I as a reader hope for when I read a book, and that I as an author like to give my readers.