She was being obedient to the law because she was impure from the birth. She had a male child,
Luke 2:22-24, "And when the days of her purification according to the law of Moses were accomplished, they brought him to Jerusalem, to present him to the Lord;
(As it is written in the law of the Lord, Every male that openeth the womb shall be called holy to the Lord;)
And to offer a sacrifice according to that which is said in the law of the Lord, A pair of turtledoves, or two young pigeons."
Lev. 12:1-4, "And the LORD spake unto Moses, saying, Speak unto the children of Israel, saying, If a woman have conceived seed, and born a man child: then she shall be unclean seven days; according to the days of the separation for her infirmity shall she be unclean. And in the eighth day the flesh of his foreskin shall be circumcised. And she shall then continue in the blood of her purifying three and thirty days; she shall touch no hallowed thing, nor come into the sanctuary, until the days of her purifying be fulfilled."
It does carry with it moral impurity for the need for purification arises out of sin. That is why there is the proscription against touching any hallowed thing or entering the sanctuary.
Gen. 3:15-16, "And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel. Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children..."
Assertion isn't proof. God commanded childbirth; God cannot command sin.
see post #329