The alliteration in "O Me! O Life!" evokes the speaker's despair—and the calm power of the voice that responds to that despair. Take a look at lines 2-3, for instance:
Of the endless trains of the faithless, of cities fill’d with the foolish,
Of myself forever reproaching myself, (for who more foolish than I, and who more faithless?)
The muffled alliterative /f/ sounds in these lines make it sound as if the speaker is practically spitting these words in disgust and defeat. (That effect is only heightened by the fact that the speaker repeats the words "foolish" and "faithless.")
The /p/ sounds in line 5 do something similar:
Of the poor results of all, of the plodding and sordid crowds I see around me,
That sharp, plosive /p/ also makes it sound a little as if the speaker is spitting in disgust—and evokes the heavy "plodding" this line describes.
But when the speaker's questions get a reply, the answering voice uses /p/ alliteration rather differently:
That the powerful play goes on, and you may contribute a verse.
Here, the strong /p/ of "powerful play" feels, well, powerful! And in linking the words "powerful" and "play," /p/ alliteration makes it sound as if power is an inherent quality of that play. Life's mere existence, in other words, is a mighty force.