The numerous poems in Dream of the Red Chamber are not just there for decoration; they have a very important purpose as a plot device. The three most important characters in the story—Jia Baoyu, Xue Baochai, and Lin Daiyu—are all highly accomplished poets, and their respective poetic talents generate a dynamic between them that drives the plot forward.
As we can also see, the poems serve to tell us something about these characters. In that sense, they are aids to characterization. For all of these characters, reciting poetry, which they do in each other's company, is primarily about revealing their inner selves.
Philosophically speaking, the poems reveal the importance of mysticism in Chinese thought of this period. Jia Baoyu and Lin Daiyu originally hail from a world of sprites and fairies. Their poems don't, then, just express their feelings but hint at the existence of an alternative reality that helps to make sense of the normal, everyday world.