(2) Mary births a male child.
Therefore,
(3) Under the Law, Mary is impure and must undergo the purification rites.
The problem is in premise (1). You are taking it as a modal statement, "Any woman, without exception, who gives birth to a male child is unclean". But the Law does not say that or mean that. The Law is remedy for uncleanness, not a stipulation that uncleanness necessarily (such that even a divine miracle cannot prevent it) follows the birth of a male child.
-A8
I'm afraid he's gotcha this time, BD. You're probably thinking of verses like:
Lev. 12:1-4 : 1 The LORD said to Moses, 2 "Tell the Israelites: When a woman has conceived and gives birth to a boy, she shall be unclean for seven days, with the same uncleanness as at her menstrual period. 3 On the eighth day, the flesh of the boy's foreskin shall be circumcised, 4 and then she shall spend thirty-three days more in becoming purified of her blood; she shall not touch anything sacred nor enter the sanctuary till the days of her purification are fulfilled. (NAB, i.e. the "Catholic" approved Bible)(Emphasis added)
Now granted, this language is very confusing, and who among us could possibly make the correct interpretation of it without being told by the Magisterium. However, to understand their logic, as it is being explained to us, perhaps an illustration would be helpful. The Law says that "Thou shalt not commit adultery" (Ex. 20:14). BUT, and this is very important, NO WHERE in scripture does it say that one shall not commit adultery on a Tuesday. Therefore, if the Magisterium declared that adultery on Tuesdays was fine, then they would be exactly in accordance with scripture. I hope this was of some service to you in understanding how the Magisterium works.