It is important to understand the setting of a poem for the same reasons it is important to understand the setting of a prose text. The setting can help to establish the mood of a poem, the feeling which the text is meant to inspire in the reader. We need to figure out, too, whether or not the poem is taking place in a real, physical location, or if it is set somewhere make-believe or abstract. This will help us to actually understand the meaning and content of the poem itself.
For example, Wilfred Owen's Italian sonnet, "Anthem for Doomed Youth," has two very important settings, and it is necessary to realize this in order to understand the poem's message. The first eight lines are set in a war zone, probably the European continent in the midst of the fighting in World War I. It is full of noisy auditory imagery and onomatopoeia, emphasizing the chaos and destructiveness of war, indicating the types of awful sounds that mark a soldier's death rather than the typical funeral sounds one might normally hear, e.g., bells, prayers, and so on. The noise characterizes the wartime setting.
The last six lines of the poem are set back at home, where there seems to be peace, and the word "shires" implies that this is England. There is a total lack of auditory imagery, and it makes use of a great deal of visual imagery instead to indicate how silent people are while they either wait for news or mourn their losses. This silence of home contrasts with the noisiness of war, and in order for us to understand Owen's point about war and the "doomed youth" it consumes, the lives it takes and the lives it ruins, we need to understand the two settings.