A Dream is a Wish Your Heart Makes (Sort Of)
Keats has a rep for being the least "worldly" of the Romantic poets—he didn't get a fancy education, he didn't have a trust fund to fall back on, and he wasn't sashaying his way through the continent on extended vacations (ahem, Byron). The upshot of this is that when Keats writes, he's writing about some of the most basic and universal human experiences. This means that dreaming, and waking up from dreams, is basically one of Keats's favorite things to write about.
In addition to studying the processes of imagination and dreaming, "The Eve of St. Agnes" also, like several of Keats's other famous poems (think "Ode on Melancholy" or "La Belle Dame sans Merci"), warns about the dangers of dreaming. Keats thinks that dreaming is awesome, but he's also pretty cautious about getting so sucked into your own imagination that you get "hoodwink'd," like Madeline.