If She avoided the pain, it would mean She was just like any of us looking after Her personal welfare though with a greater power at hand. On the other hand taking upon Herself the pain of creation with the object of transmuting it is Her very purpose of human birth. In fact the very act of assuming a human body is a pain for any Divine being.
Pain is due to knots of resistance in the human body to the higher consciousness. So while personally She had mastered all pain way before, She had to now do it for others. Hence She took up the general resistance in human consciousness and forced Her Light and Force into it leading to the pain. If humanity was more receptive and open, less resisting then it could have been avoided.
Basically being the Mother She took upon Herself the pain of Her children and bore it so that the human body may open more and more to the Divine Light and Force and Love.
Affectionately,
Alok Da