This is just purely ex post facto pseudo-scientific rationalism of rampant misogyny. If you want to be true to the statements made in historical sources (e.g., the bible), try to put yourself in their shoes -- in this case, imagine that you are a patriarch in a deeply misogynistic society that views women and children as property and not people. The reason for the law is thus completely justified to such a person: to them, menstrual fluid is gross and just another example of why women clearly do not have the full rights of a "real person".