To the average observer, Sunset Shimmer made a full one-eighty when she was hit by the Rainbow Blast back when she turned into a She-Demon. However, she didn't just suddenly turn good or realize her mistakes. Truth be told, she died back then. She was welcomed into the cold embrace of death.
In that darkness, she found him. The one they call Sombra, there to welcome her to her doom. Surely a bright mind like her's knew the Price of Evil.