A thousand year's banishment is enough to break anypony — and Princess Luna, poor Princess Luna, was no exception! Having everything taken from her and not a single candle's light in the darkness of her future tore her apart. But…even she could not spend a thousand years in misery. Eventually, the fragments came together, but…not quite in the same shape they had been before.
The great power that the Nightmare offered her could be turned towards maintaining her sanity. A thousand years alone with nothing would have left only a fragile husk when she returned to Equestria. She solved this problem through the creation of illusions; it started with a single spectral pony, then a house, then a village… Soon enough, she had managed to create her own 'version' of Equestria. Mind you, the false ponies weren't intelligent — merely followed commands and devoted themselves utterly to Luna.
Of course, without a society to keep her in check, Luna quickly fell into power addiction and decadence. The ponies were toys for her to play with, and the land itself her playpen. She engaged in various depravities over that thousand year span… and here, we see just one of them.