I know in Romance we have to have happy endings, and I'm glad about that. My nephew wrote a great little science fiction story for a school project and it didn't have a happy ending. The hero kind of redeems himself in the end, but he dies. Along the way he meets a woman and falls for her, but ultimately it goes no where, because he dies. I loved his story and it occurred to me that I'm completely not used to things not working out perfectly for the characters in books. Because I write strictly romance.
I prefer writing stories that end happily, and I'm not sure why there's sometimes the perception that because romance books are supposed to end happily they aren't to be taken seriously. That's nonsense. You can tell a gripping, meaningful story and have a happy ending too. There's no reason it has to be one or the other.
But maybe that's just me. :)