The basic principle of this chapter is that giving birth to a male or female child causes the mother to be unclean for a certain amount of time, double for a daughter compared to a son. The text references the time of purification for menstrual bleeding, which is something that we will find later in Leviticus, so the reference here is correct but a bit premature.
After purification is complete, the mother must make an offering as described, which like the burnt offering of Lev 1, allows for a bit of economic scaling in case of poverty, and even specifically tells us that it is for economic reasons (v. 8, "if she cannot bring forth a lamb"), while before it was inferred. Like before, we see a coupling of different offerings, in this case a sin offering and a burnt offering.
So this law is relatively straightforward in content, but it leaves us with troubling questions about its purpose or rationale, especially with the doubled period of impurity from bearing a daughter. Of course, it's important to remember that ceremonial impurity is not sin or "wrong", so I don't think it's correct to think of this as some sort of punishment for bearing a child.
But still, we know this is a time period and a society that systematically devalued women, so it's natural to think that the longer period of impurity for a daughter it's because women are somehow considered "less clean", and therefore require more purification. Furthermore, why is there a period of impurity after childbirth at all? To many, this reeks of subjugation.
I've skimmed around looking at some major commentaries, and it seems that the answers fall into two general buckets. Broadly speaking, what this prohibition relates to is the bleeding of fluid, which is increased following childbirth. For the first couple days (likely coinciding with the 7 days of v. 2) a post-birth mother excretes lochia rubra, and then for a couple weeks after that, lochia alba. See wikipedia for basic info. As before, the two general explanations for why this results in impurity are the "desert living" hypothesis and the "spiritual" interpretation.
The desert living hypothesis would claim that vaginal bleeding, as with any other type, risks the possibility of spreading infections to others, whether parasites, bacteria, etc. Secluding people who are actively bleeding would possibly be viewed as a preventative measure. This theory is supported by the correspondence between the duration of lochia and the days of impurity after giving birth to a son. Blood-born illnesses are a reality today, but were possibly even more prevalent in ancient Israel.
The spiritual interpretation is that mankind is sinful at birth, and therefore the period of impurity is intended as a reminder of that sinfulness, having brought a new sinner into the world. I'm not particularly fond of this theory because it clashes with the broad optimism towards children that we see in the rest of the OT, but I've seen enough references to it that I think it's worth mentioning.
I would like to remind my readers that the OT in general views children very, very positively. We saw the tremendous strains that Sarah's barrenness put on her relationship with Abraham, and were told that after Isaac was weaned, Abraham hosted a great feast to celebrate. God used Isaac as a symbol of the covenant and his promises to Abraham. Rachel begged for Jacob to help her bear children, and when that failed, submitted her maidservant to bear children on her behalf. The biggest threat of the Egyptians to the Israelites was killing their male children, and God's judgment of Egypt was slaying their firstborn sons. It is difficult to believe that the Israelites are now expected to view childbirth as this effluence of sin that must be set apart from the people. I think it is extremely likely that bearing children would (continue to) be a triumphal moment for both the mother and father, just as it was for their ancestors.
It's harder to explain why the period is doubled for female births. For the desert living hypothesis, I offer the following quote from Keil and Delitzsch Biblical Commentary on the Old Testament:
The prolongation of the period, in connection with the birth of a girl, was also founded upon the notion, which was very common in antiquity, that the bleeding and watery discharge continued longer after the birth of a girl than after that of a boy (Hippocr. Opp. ed. Khn. i. p. 393; Aristot. h. an. 6, 22; 7, 3, cf. Burdach, Physiologie iii. p. 34). But the extension of the period to 40 and 80 days can only be accounted for from the significance of the numbers, which we meet with repeatedly, more especially the number forty.The 40 and 80 are, of course, the sum of 7 + 33 and 14 + 66 respectively.
For the spiritual interpretation, the answer usually given is that circumcision results in the shedding of some blood, so that "makes up for" some of the mother's bleeding. I.e. the mother and son together shed a certain amount of blood, and that's "good enough". John Wesley, for instance, writes about the 66 days of purification for a daughter:
Threescore and six days - The time in both particulars is double to the former [for males], not so much from natural causes, as to put an honour upon the sacrament of circumcision, which being administered to the males, did put an end to that pollution sooner than otherwise had been.Some commentators note that blood is often associated with guilt or sin, so expunging blood could somehow be viewed as a type of purification. I partially agree with this. We have certainly seen the shedding of blood associated with atonement for sin, yet before I said that childbirth is not sinful, it only results in ceremonial impurity. And this is one of the big weaknesses with the spiritual interpretation, that it is (whether intentionally or not) conflating ceremonial impurity with some sort of implied moral sin in childbirth, and after all the work I went through to show the difference between ceremonial law and moral law, I'd rather not have to go through that again.
In conclusion, I cannot prove that this is not an example of gender inequality in the bible because we simply aren't told the reason for this set of rules. However, I believe the desert living hypothesis is reasonable and I leave the final judgment of this chapter to my readers.