The stories in the Puranas contain many incredible and hard-to-believe occurrences. But they should not be interpreted as a nursery rhyme. Their language is Shakespearean and laden with great depth and meaning. We need to interpret these stories with a very refined state of mind.
The story goes that Parvati created a boy out of dirt from her body and appointed him to guard the doorstep. The first question that comes is how could Parvati, the Goddess Herself, have so much dirt? Parvati symbolizes the triguna – sattva, rajas and tamas. The entire creation is made up of trigunas. The dosha or imperfections that originate out of the triguna is an obstruction for the functioning of Prakriti.
That was the boy that Parvati created to stand guard at the door. Shiva is Shuddha Chaitanya, pure consciousness.