The poem is jam-packed with alliteration. First and foremost, this effect makes the poem highly musical (especially in combination with the poem's use of assonance). This is a solemn, lyrical, tightly woven elegy for fallen soldiers.
Second, alliteration helps evoke some of the poem's sights and sounds. Listen to the prominent /m/, /w/, and /b/ sounds in line 9, for example:
By the May breeze, murmurous with wasp and midge,
The /m/ sounds, especially, evoke just what the line's describing: the buzz and drone of wasps and flies. In this way, alliteration works hand in hand with the onomatopoeia of "murmurous."
Dense alliteration can also slow the poem's pace, making its language sound heavy and deliberate. This is an especially important effect in lines 15-18:
And the far valley behind, where the buttercups
Had blessed with gold their slow boots coming up,
Where even the little brambles would not yield,
But clutched and clung to them like sorrowing hands;
These lines literally describe slow movement: the heavy marching of troops up the slope of a valley, where sharp "brambles" catch at their clothing as if to hold them back. Fittingly enough, then, the cluster of /b/, /w/, and /cl/ sounds (along with the assonance in "clutched" and "clung") slow the language to a crawl.
Other alliteration makes the language sound punchy and percussive—an appropriate effect in a poem full of bombs and bullets. You can hear an example of this in line 42, which describes soldiers managing to survive on a hellish battlefield:
And there out-fiending all its fiends and flames
The barrage of fricative /f/ sounds is as rapid and harsh as the bombardment they're facing!