Reading "The Vanity of Human Wishes" out loud is a little like swinging on a swing. The rhythm is very regular, and it kind of lulls us into this nice back-and-forth movement. Let's take the first few lines of the poem, for example:
Let observation with extensive view,
Survey mankind from China to Peru.
Remark each anxious toil, each eager strife,
And watch the busy scenes of crowded life. (1-4)
We're swinging back and forth between the syllables and the sounds as we read those lines.
We'll find this rhythm throughout the rest of the poem (check out "Form and Meter" for the details). Johnson often also repeats letters and sounds in a particular cluster of lines, in a technique called consonance. In the lines, "How nations sink, by darling schemes oppress'd,/When vengeance listens to the fool's request," there's a lot of repetition of the S sound, which adds to the musicality of the lines.
All this repetition also subtly reinforces the sheer scope of all the bad… stuff that this poem takes up. Every little human endeavour, every human wish, can turn out bad. Don't believe our speaker? Well here's a few hundred examples to prove you wrong. And while you're going through all of those, the repetition in the poem's sounds will be there to underscore the exhaustive (and exhausting) nature of the speaker's investigation.