Alliteration fills the poem with gentle music, evoking the beauty of the natural world that surrounds the speaker. In the opening line, for example, the lilting /l/ sounds of "living lamps" and "light" conjure the delicate, flickering beauty of the glow-worm's precious light. Those /l/ sounds are themselves like little flashes of light on the page.
Frequent sibilance, meanwhile, casts a hush over the poem, conjuring the quiet of the night. Just listen to all the /s/ alliteration in lines 2-4 (plus the consonance of "matchless"):
The nightingale does sit so late,
And studying all the summer night,
Her matchless songs does meditate;
The humming /m/ alliteration of "matchless"/"meditate," along with the consonance of "summer," adds to the soothing, gentle tone of these opening lines. The natural world seems like a lovely, comforting place to be.
In the next stanza, alliteration evokes the crisp crackle and sparks of "country comets" soaring across the sky. The firm, plosive /p/ sounds of "portend," "prince's," and "presage" add yet more energy and excitement to these lines, conveying the speaker's strong admiration for the glow-worms' beauty.
Later, note the fricative /f/ alliteration "flames" and "foolish fires" (plus the consonance of "officious"). The poem's sounds call attention to the juxtaposition between these two very different kinds of light: the warm, guiding "flames" from the glow-worms and the misleading "fires" of love and lust.
Note, too, how this sonic prettiness falls away in the final stanza. It's no coincidence that when Juliana arrives in the poem, the lovely alliteration almost entirely disappears.