"On that night King Achashverosh could not sleep": On that night nobody could sleep -- Esther was busy preparing the banquet for Haman, Mordechai was busy with his sack-cloth, and Haman was busy with building his gallows. So the Holy One blessed be He summoned an angel and said: "Look! my children are in danger and that evil king sleeps! Go disturb his sleep!" So the king was unable to sleep and he read of the righteous from the books of account, which led to Mordechai being exalted at the expense of Haman.
I learned this from Sefer Ha-Aggadah, which cites Esther Rabbah 7:13 and 9:4.