There are two different but similar things going on in the Gospel for today. Mary and Joseph have brought Jesus to the Temple to present Him to the Lord. They have also come for the purification of Mary.
Forty days after a woman bore a child, she had to undergo purification rites. For the Jewish people, contact with blood made one “unclean,” meaning they could not go out in public, and that included going to the synagogue. Forty days after bearing her child, the woman would go to the synagogue, to the rabbi, and take part in a ritual bath that restored her to purity. Then she could resume her life.
If the child was a first-born son, then it was required to be consecrated to the Lord. When the 10th plague took place in Egypt, it was the death of the first-born son. This included not just the human children, but also the first-born male animal of every species. The Hebrews were spared this fate because they were told to put the blood of the Passover lamb over the lintels of their doors, and the Angel of Death “passed over” their homes. Because the first-born sons of the Hebrews were spared this plague, the family had to take the child to the priests or rabbis and “present” him to God, declaring that this child belonged to God. The parents would then buy back, or “redeem” the child. For a poor family such as Mary and Joseph, the fee to buy back the child was a pair of turtledoves, or two young pigeons, which is what the Holy Family offered.