Bent double, like old beggars under sacks,
Knock-kneed, coughing like hags, we cursed through sludge,
Till on the haunting flares we turned our backs
And towards our distant rest began to trudge.
Men marched asleep. Many had lost their boots
But limped on, blood-shod. All went lame; all blind;
The soldiers turn away from the lights and noise of war and head back in the direction of their camp. 
 These flares are sent up to light no-man’s land so that any opposing forces can be spotted. They metaphorically hang in the air like ghosts and remind the soldiers that those flares may lead to their deaths, hence ‘haunting’. The word itself begins with the  aspirant consonant  ‘h’ followed by the long  diphthong  ‘au’. So ‘haunt’ has, literally, a haunting, lingering impact. 
 
 The reference to “flares” introduces a recurrent or extended metaphor of fire which is referred again later in the poem. This helps to craft an atmosphere of violence, preparing the readers for the horrors of war which will be described.