Whitman uses repetition to emphasis images he wants the reader to focus on, and to make the spider seem larger than life, as it is in its world.
Repetition is the process of repeating a word or line for emphasis. In line 4, the word “filament” is repeated, creating an image in the reader’s mind. You can see the spider’s web forming. The image clarifies the speaker’s impressions of the spider in the reader’s mind. In its world, the spider is central.
And you, O my Soul, where you stand,
Surrounded, surrounded, in measureless oceans of space,
Ceaselessly musing, venturing, throwing,—seeking the spheres, to connect them;
In these lines, “surrounded” is repeated twice, makes the reader see the vastness of space from the spider’s point of view. For the same reason “O my Soul” is repeated to help the speaker reflect on the emotion of the metaphor of the spider in his space to the conversation with his soul. We are all connected as humans, like the spider’s filaments. We are all noiseless and patient in the vast universe on our tiny planet. We are more like the spider than we think.