Obi-Wan's Emotions and Dilemma
Obi-Wan Kenobi left Anakin Skywalker alive but in excruciating pain after their duel on Mustafar in Star Wars: Episode III - Revenge of the Sith, but his decision wasn't made to take revenge on his former Padawan.
Emperor Palpatine in the Senate in Revenge of the Sith
Anakin had just fallen to the dark side, and Obi-Wan was tasked with fighting his beloved Padawan. At the time, Obi-Wan seemed to be the last hope of stopping Anakin, and it appeared the only way to do that was by killing him.
Matthew Stover's novelization of Revenge of the Sith fleshes out the story, revealing more about Obi-Wan's emotions during the duel. Throughout the fight, Obi-Wan knew that killing Anakin would 'burn his heart to ash.' He also expressed regret at the thought of the man Anakin could have become. Even with everything Anakin had done, from killing Mace Windu to killing younglings, Obi-Wan empathized with him.
Obi-Wan Kenobi season 2 might explore this moment further, but it wasn't empathy that kept Obi-Wan from killing Anakin.
Obi-Wan's Struggle and the Arrival of Palpatine
Stover revealed that Obi-Wan had multiple reasons to kill Anakin after their duel. Yoda had told him that he needed to kill his former Padawan to put him out of his misery after his fall to the dark side. He had also let go of his attachment to Anakin during the fight, making it possible for him to fight with all his might. What stopped Obi-Wan from finishing Anakin off, though, was the dark feeling that accompanied Emperor Palpatine's shuttle landing on Mustafar.
'Obi-Wan looked down. It would be a mercy to kill him. He was not feeling merciful. He was feeling calm, and clear, and he knew that to climb down to that black beach might cost him more time than he had. Another Sith Lord approached.'
Obi-Wan eventually left Anakin to the will of the Force when he realized that he could not kill Anakin because he was still a Jedi, and the Code prevented him from murdering a helpless man. However, had it not been for the Emperor's approach, Obi-Wan might not have come to that realization.
The Impact of Obi-Wan's Decision
If Obi-Wan killed Anakin, the reign of the Empire would have been hugely different. Palpatine would not have had his apprentice to enforce his rule throughout the galaxy, and he also wouldn't have the symbol of fear that Darth Vader became. The biggest effect would be felt by Luke Skywalker, though. Without his father, Luke might not have even become a Jedi, as Vader forced Leia to hide the Death Star Plans. If he had still become a Jedi, he would have had to face Palpatine alone. Without Anakin returning to the light and killing Palpatine, Luke would have had an almost impossible fight.
Obi-Wan Kenobi wielding his lightsaber next to Darth Vader from the series.
Though it didn't feel like a victory, Obi-Wan sparing Anakin in Star Wars: Episode III - Revenge of the Sith planted the seeds for Luke to eventually triumph. Obi-Wan followed the will of the Force and it led to Palpatine's death. Ironically, Palpatine himself helped make sure Anakin survived long enough to kill him by interrupting Obi-Wan on Mustafar.