What a disturbing nursery rhyme! It appears to be about a dismembered foot. How do all these toes go their separate ways like that? Grisly doings!
I'm sure there's some grim event at the heart of it, lost to us now, lost to time. Some psychopath lopping off toes, back in the days of hay wains and villagers, and this charming little bit of frippery was concocted to explain it away, reassure the kids about the sort of world in which they live. That's how all these nursery tales and nursery rhymes start: something very nasty at the center. Turn it all into a joke. Wee-wee-wee all the way home and everyone collapse into giggles!
That's all well and good, but I prefer the nursery tales with the grim moral lesson.