All rulers eventually reach a point where they must take a life to save the realm. If a ruler is just, they will never know when it will happen, and will never do it lightly. Still, such actions are necessary. Princess Celestia knows this, and has given this lesson many times.
You can find a YouTube reading of this story here!