Now, with regard to the question above, we don’t really know why God gave this command. Sometimes God’s instructions reflected cultural views held during that time. Ancient peoples may have believed a woman bled longer after delivering a girl. Or perhaps the passage acknowledges the higher value their culture placed on males. Though such a perspective seems unfair today, Biblical teaching raised the status and rights of women far above any other laws or cultures of the time.
–The Quest Study Bible