Since William is a boy, people around him including his parents want him to act like a "male". This song has a sexist issue, and William's grandma solves the problem. People think he should not play with a doll, because it's a girl/female thing. They think since he is "Physically" a boy, he cannot play like girls do. This is a sexist idea. I remember that when I was young, I did not just play with dolls like other girls; I also played with toy robots and legos, and played sports with my boy friends and girl friends. I have not been grown as a girlie girl. I guess my parents wanted me to be grown as a girl who can learn both males' roles and females' roles like William's grandma. In this song, William's grandma wants him to play with a doll so he can learn how to be a father who can take care and support his kids like his future wife. Females and males only have physical differences. This song is trying to say, no matter whether you are a female or a male; you all have similar roles and responsibilities, so don't separate two different genders to divide their roles.
This clip I found on You Tube is related to the lyrics, "William's Doll". Check it out if you are interested!