Varaha Purana gives answer for Yajnopavetha of snakes. As per Varaha Purana, Lord Shiva cursed him to get Yajnopavetha of snake. As mentioned in this answer, Lord Ganesha manifests differently in different Kalpas.
Once Devas asks Lord Shiva to create a being to destroy obstacles. Lord Shiva sees Uma and creates a being. After creation of beautiful being, Shiva as part of His leela, curses that boy to get Elephant's head, protruding belly and Yajnopavetha of Snakes.
This is how Chapter 23 Part1 of Varaha Kalpa describes birth story of Vinayaka:
The gods said:
"O great god with three eyes and trident in hand, it behoves you to create (a being) for obstructing the actions of the bad".
Thus requested by Devas, Rudra with great pleasure looked at Uma for a moment.
When he was looking at Uma in the presence of gods, he was worried why no form of his was seen in the sky.
"There is the body in earth, there is one in water; so also in fire and air.
11-15. How is it not there in sky ?" So thinking he laughed. By the
power of knowledge, by what was seen by Rudra in the sky, by what was
said by Brahma formerly as the body of all beings, by the laughter of
Rudra, by all these four in the four elements Earth and the rest,
there arose a boy effulgent with glowing face, looking like Rudra
himself and stupefying Devas with the charm of his dazzling
brilliance.
Seeing the person of this great boy, Uma remained with eyes stuck on him.
Looking at the beautiful form of the boy and thinking of the fickleness of women's minds Rudra got angry and cursed him.
"O boy, you will attain an elephant's face, protruding belly and yajnopavlta of serpents".