Strangely, Obi-Wan Kenobi smiles just before being killed by Darth Vader in the original Star Wars movie, but if fans were to look at the scene from a certain point of view, they would find a deeper meaning behind the Jedi's death scene. Star Wars is the franchise of franchises, and it's one that continues to give - either through rewatches, new canon explanations, or twists that shed new insights on old events. And all three reasons can apply to several of Obi-Wan's scenes.
Throughout A New Hope, Obi-Wan shares with Luke Skywalker - and in turn, the viewer - the history of the Jedi and their purpose in the galaxy, and he becomes the go-to point whenever something new is brought up. Because of him, viewers learn about the Jedi, Clone Wars, Darth Vader, and even the Tusken Raiders. But looking back on those scenes with new context from the many sequels and TV shows that have released over the years is eye-opening. A scene that's revisited the most is the one in which he gives Luke his father's lightsaber, but another scene that also should be reexamined is his death.
George Lucas may have had his reasons for wanting Alec Guinness to smile as Obi-Wan Kenobi was killed, which came as Luke and the rest of the team were beginning to make their escape, but that scene has a new meaning when taking Return of the Jedi's twist into account, not to mention Star Wars: Episode III - Revenge of the Sith's ending. In Return of the Jedi, Luke realizes Leia is his sister, but that's something Obi-Wan already knew (canonically). And he also knew they hadn't seen each other since they were born and subsequently separated... until they reunited on the Death Star (h/t Mads). At that moment, Obi-Wan sees them together for the first time in decades, smiles, and then allows Darth Vader to kill him.
Of course, all of this wasn't known when the original Star Wars movie was first made. Lucas may have had some inklings of a greater universe to explore, but every twist that came after A New Hope, including Vader and Leia being Luke's father and sister, respectively - which also makes the Death Star scene the only real family reunion in the original trilogy - was decided later on. But this is Star Wars, and fitting new details into the old canon is possible given that everything happens from a certain point of view.
Furthermore, all of this boils down to Guinness' portrayal of Obi-Wan Kenobi. His acting in A New Hope as well as the rest of the original films allowed for deeper exploration into his character years after the trilogy ended. At the time, it's likely Obi-Wan smiled because he was about to become one with the Force, and he was fine with that after seeing Luke, their last hope, make his great escape. However, the completion of Lucas' Star Wars story showed that there was more going on than initially thought.