Throughout this poem, several figures are anthropomorphized: the sun, the moon, the Walrus, and the Oysters. This device fits in with the conventions of Victorian "nonsense" verse: talking animals and heavenly bodies make the narrative a lot more whimsical and surreal.
The poem begins by treating both the sun and moon almost like a bickering brother-sister pair. The sun proudly, boldly, does "his very best" to illuminate the world below—despite the fact that it's nighttime! The moon, rather understandably, is irked by this invasion into her domain. She believes that the sun has "no business" hanging around after dark and says, "It's very rude of him [...] To come and spoil the fun!"
The poet, Lewis Carroll, clearly knows this is all very silly; his speaker seems to repeatedly wink at the reader, pointing out how "odd" it is that the sun is shining in the middle of the night or that the eager little Oysters wear neat and tidy shoes despite not having "any feet."
Still, despite the silliness, this anthropomorphism also serves a thematic point. Anthropomorphizing the poem's non-human figures (in other words, everyone except for the presumably human Carpenter) allows the speaker to introduce some very human-seeming conflicts and power imbalances into the story. The sun shines in the middle of the night without regard for the moon's feelings or boundaries, while the moon "sulkily" criticizes his rudeness. The Walrus is capable of both animal appetite and human subterfuge—able to trick the Oysters into enthusiastically joining him and the Carpenter—but the Oysters are also able to beg for mercy and underscore the unfairness of their condition. The anthropomorphism in this poem allows the sun and the Walrus to knowingly abuse their power, but it also evokes pity for the victims of these abuses.