It's informal but grammatically correct. I think it would be better style to put the "wee wee wee" within quotation marks, I'd hyphenate them to suggest a continuous squeling, and I'd use "cried" rather than "went" to avoid ambiguity, see below. Thus:
And this little piggy cried "Wee-wee-wee," all the way home.
This is grammatically the same as
And this little piggy squeaked all the way home.
My mother played it with me, I played it with my kids, and I now play it with my grandchildren. I don't tickle them, I just wiggle their little toe. The "wee wee wee" part is said creatively--jokingly--with extreme rising and falling pitch. "Wee, wee, weeeeeeee, wee-wee-wee-wee-wee" etc.
It is NOT being used this way in this poem, but "wee-wee" CAN be an nursery euphemism for urination. If a toddler says "I need to go wee-wee," you lead him to the bathroom. If you say the piggy "cried wee-wee-wee" there is no ambiguity. If you say the piggy "WANT wee-wee-wee" many people will have a fleeting thought that the piggy might be urinating.
I once was in a chorus, we were rehearsing the famous Christmastime song "Jingle Bells," and we got to the lines about a sled falling in a snowbank:
"The horse was lean and lank
Misfortune seemed his lot
He got into a drifted bank
And we—we got upsot."
The chorus director stopped us, and said "Get out your pencils and make a change. We are going to sing 'and THEN we got upsot.' I don't want to have any 'wee-wee' in this song."