The lesson Anakin taught Ahsoka is so layered. You can take it literally. Its tempting to give up, to stop doing the right thing. But if you stop fighting, you will literally die. You can take it as a metaphor. Death of self. Anakin chose to stop fighting to do the right thing. He gave in to his fears. Anakin died and Vader rose. To live is to keep fighting.
It's also about legacy. She is part of a legendary legacy (From Yoda to Dooku to Qui-Gon to Obi-Wan to Anakin). Ahsoka's rejected that legacy for years. Walked away from the Order. Learning that Anakin turned into Vader has made her question everything he ever taught her and meant to her. She hasn't been able to reconcile that. He wasn't just a mentor, he was her friend and she loved him. Anakin tells her Vader may be a part of him, but it's not all he is. It's Ahsoka's duty to carry on and pass down the positive parts of Anakin.
When she spares him, she's choosing to see him as more than just Vader. She chooses the life of Anakin instead of his death into Vader. She recognizes the good in him and his legacy.