The head is where the mind resides, upon which the aham feeds. In Shiva Puran, while following order of his mother, Ganesh becomes extremely violent. Even Shiva and Vishnu are unable to defeat him in a fair duel. Finally Vishnu distracts Ganesh while Shiva chops off his head.
Everytime, it has to do with Prakriti.
Brahma wants to make Prakriti dance to his whims . Daksha wants to manipulate on Prakriti. Ganesh blocks the access of Purusha to Prakriti. Chand and Mund want to curb Prakriti. Mahishasur underestimates Prakriti.
And whenever Prakriti is ill-treated in any way, the beheading happens. But this time, the twist is that Parvati herself appoints Ganapati as her guardian. He's not any Asura who obstructs access to her.
Earlier, when Nandi was guarding door of Parvati, Shiva just walked inside without obeying her wife's wish. Parvati feels upset at this nature of Shiva. He simply cannot force his way to her everytime. Not all secrets of Nature can be made accessible to human mind.Prakriti does not want itself to be taken for granted.
When the war happens between Ganesh and ganas of Shiva, Devi wonders why is Shiva showing such impatience to meet her? When she needed him for producing a child or making a home, he ignored her. But now when she's demanding some space, why is Shiva not respecting her wish? Why this impatience?
And when she sees her son beheaded, the anger materialises out of her. She takes her Prachchand Ugra roop by summoning all her Shaktis. These Shaktis, on the order of Parvati, kick off the gods and cause great terror to them. It is then Shiva realizes why she's angry. She's tired to be taken for granted.
But another thing to notice is that Ganesh is made up of dirt and grime that had disposed off from Devi's body. This is significant.
Dirt and grime are what we ignore and cast away. They're by product of our body, hence ignored. Thus, Ganesh has this idea of ignorance inside him, that climbs up to his head and makes him ignore Shiva. He refuses to recognise his father's divinity. Ganesha ignores all the requests made by Brahma, Vishnu and other ganas to unblock the entrance. This ignorance is removed by Shiva when he chops off the head. Ganesha clearly cannot just be a guardian of Prakriti, he has to do darshan of Purusha as well. Thus, whereas Parvati creates Ganesha, Shiva completes him. This is a contast to Murugan, where Shiva solely creates him but Parvati completes him.
Why the elephant head?
Elephant has always been a symbol of material affluence.
But Shiva is Gajantaka and he wears elephant's hide around his waist. He refuses such material aspects of Nature. But now the same Gajantaka becomes the father of Gajanana?
Elephants are a symbol of material prosperity. They flank Lakshmi. They were used by Royal kings in ancient India to show off their wealth and prosperity. Elephants live at place which has abundance of food and water. As Gajantaka, Shiva rejects the material benefits. He shuns the darshan of Prakriti. He remains in his spiritual state of Sat-chit-ananda. He seeks contentment in spirituality.
But when he puts elephant's head on the lifeless body of his son, this depicts that Devi have become successful. The hermit has transformed into householder. He has learned to be patient with shortcomings of others and has recognised the value of Nature. He follows her request to revive her son. Clearly, he responds to her needs. Devi becomes happy on seeing this. This son now becomes a symbol of material affluence, auspiciousness and contentment, embodying the idea of both of his parents. When this happens, Parvati calms down and smiles. Through Ganesha, her intentions have succeeded. Shiva now does her darshan. This makes Ganesha Mangal murti, the auspicious one.