Why the ending works
There have been a couple of recent threads to the effect that the ending "didn't work" for one viewer or another. When we say something "didn't work for me" we're acknowledging that our expectations can get in the way.
Ultimately, this is a story about loss. Tolkien introduces us to an imaginary world, shows us why the saving of that world was worth sacrifice and then acknowledges that even the sacrifice won't save everything for everybody. This is difficult for modern audiences. We like happy endings (or dystopian worlds that suggest that nothing is worth saving).
My parents' generation saved our world from two totalitarian regimes but the world they inherited was not the world they remembered. My generation tried to build on their sacrifice, to make the world more just and fair, but most days it certainly doesn't seem like the world we imagined.
Tolkien lost most of his friends in one World War and had to watch his son go off to fight another. The ending of this story does not hold out false hope and I think that disappoints a lot of viewers who would like to see Aragorn's coronation followed by applause for the Hobbits and rolling credits. Life doesn't work that way and it's to Tolkien's and the filmmakers' credit that they didn't end the story that way.