Side-topic: Shows that ended really re-enforcing their original theme:
If we can nominate the different endings for Futurama, I'll do the same for Scrubs -- the original season 8 finale was incredibly right for the series as a whole ("And who's to say this isn't what happens? Who can tell me that my fantasies won't come true? Just this once...").
By that token, Malcolm in the Middle did a great job of refocusing the show back to the central theme of growing up 'super-smart' (and how that doesn't solve everything and isn't a goal in and of itself).
Perhaps more darkly (but still appropriate), Dinosaurs ending with their entire society about to go extinct was way more appropriate for a show about anthropomorphic dinosaurs than anyone would have expected from a children's/family show of that era.
Finally (and somehow ending up in reverse-alphabetic order), Bojack Horseman is the perfect finale for that show in that it doesn't provide a sense of closure or wrap everything up with a tight little bow.
Other shows with good endings:
The Americans
Band of Brothers
Fleabag
The Fugitive
Gravity Falls
Justified
The Leftovers
Life on Mars
The Mary Tyler Moore Show
M*A*S*H
The Prisoner
Reservation Dogs
The Shield