Twilight had been ruling for years. 23 to be exact. She could deny it all she wanted, but she was struggling. She suffered in the shadow of her mentor and former Princess of the land she now reigned over. Celestia had been the prime, and debatably only, example of a good ruler. In her retirement she left a legacy. A legacy Twilight believed she could never live up to.
She only got worse when she finally heard the news of her dear mentor's passing. The nation mourned the loss, but had faith this would make no change to their beloved Princess Twilight. She was strong, she was mighty, she was all-loving. If they were to trust anypony, it'd be the one who'd defended them for decades and was now leading peacefully.
A few years prior, Sombra was revived by none other than Princess Flurry Heart. His Dark magic was to be stripped and stored, and he himself was to be reformed. The plan was a success. Ponies and creatures alike now lived happily alongside the former tyrant. They trusted his magic would never get into the wrong hooves again.
Twilight couldn't possibly result to such a drastic measure. Not yet at least. This was just a simple blip, she'd recover. Besides, dark magic was imperfection. But the idea became the more tempting over time as her struggles worsened and her confidence withered. She now had a student. A real student. Starlight was her student yes, but this was different. She had to be absolutely perfect now for Luster Dawn, if not for Equestria.
Dark magic sounds imperfect in concept, but really it's the other half to Light magic. They balance each other out! This is what Twilight's been missing all along! The only reason Sombra got corrupted was because he didn't have enough Light magic, but Twilight was a full fledged alicorn. With this other half to complete her, she'd finally be perfect. A perfect friend, sister, aunt, tutor, and most importantly, a queen.
Before Twilight could take the magic however, it'd already found her. She's corrupted under the cover of night, and becomes Queen Nightfall. Now that she was perfect, so must be her citizens. Mixed tribes weren't perfection.