“Sleep and Poetry” is a veiled criticism of neoclassical poetry—the “foppery and barbarism” of the eighteenth century. Both Pegasus and Apollo, as described within the poem, are muses of poetry. The neoclassicists, although they believe themselves to be real poets, are not pleasing the muses. Although they believe they are pleasing Apollo and writing poetry which, so to speak, rides on the wings of Pegasus, they are merely on a “rocking horse”: “[they] sway’d about upon a rocking horse / And thought it Pegasus.”
It is important to understand why Keats criticized neoclassical poetry, which is central to understanding the beautiful, sensuous imagery of the poem. Keats, as one of the founding fathers of the Romantic movement in English poetry, thought that art should be centered above all on imagination, sensation, and beauty. We know this already from the famous last line of “Ode on a Grecian Urn”: “Truth is beauty, beauty is truth,—that is all / Ye know on earth, and all ye need to know.” Neoclassical poetry, centered around form (based on Greek and Roman poetic structures), the intellect, and educating its readers, is opposed to Keats’s Romantic notions of poetry. The entire poem is animated by this clash in ideology. Classical poets’ writings have themes which are “ugly clubs . . . / Disturbing the sea.” By contrast, the first few stanzas (as well as the last) are meant to show us what Romantic poetry can do, urging the reader to consider the rejuvenating beauty of nature and sleep.
For more on the definition of neoclassical poetry, see the link below.