Luke 2:21 And when eight days were accomplished for the circumcising of the child, his name was called JESUS, which was so named of the angel before he was conceived in the womb. 22 And when the days of her purification according to the law of Moses were accomplished, they brought him to Jerusalem, to present him to the Lord; 23 (As it is written in the law of the Lord, Every male that openeth the womb shall be called holy to the Lord;) 24 And to offer a sacrifice according to that which is said in the law of the Lord, A pair of turtledoves, or two young pigeons.
Sanctification of the firstborn was established in Israel because God spared the firstborn when he killed the firstborn of the Egyptians.
Exodus 13:1 And the LORD spake unto Moses, saying, 2 Sanctify unto me all the firstborn, whatsoever openeth the womb among the children of Israel, both of man and of beast: it is mine.
The firstborn belonged to God and had to be redeemed by payment to the priest.
Exodus 13:11 And it shall be when the LORD shall bring thee into the land of the Canaanites, as he sware unto thee and to thy fathers, and shall give it thee, 12 That thou shalt set apart unto the LORD all that openeth the matrix, and every firstling that cometh of a beast which thou hast; the males shall be the LORD’S. 13 And every firstling of an ass thou shalt redeem with a lamb; and if thou wilt not redeem it, then thou shalt break his neck: and all the firstborn of man among thy children shalt thou redeem. 14 And it shall be when thy son asketh thee in time to come, saying, What is this? that thou shalt say unto him, By strength of hand the LORD brought us out from Egypt, from the house of bondage: 15 And it came to pass, when Pharaoh would hardly let us go, that the LORD slew all the firstborn in the land of Egypt, both the firstborn of man, and the firstborn of beast: therefore I sacrifice to the LORD all that openeth the matrix, being males; but all the firstborn of my children I redeem.
God took the Levites in service instead of the firstborn males when they first came out of Egypt.
There were more firstborn males than Levites.
Those over and above the number of Levites had to be redeemed by a payment of money.
Numbers 8:17 For all the firstborn of the children of Israel are mine, both man and beast: on the day that I smote every firstborn in the land of Egypt I sanctified them for myself. 18 And I have taken the Levites for all the firstborn of the children of Israel.
Numbers 3:11 And the LORD spake unto Moses, saying, 12 And I, behold, I have taken the Levites from among the children of Israel instead of all the firstborn that openeth the matrix among the children of Israel: therefore the Levites shall be mine; 13 Because all the firstborn are mine; for on the day that I smote all the firstborn in the land of Egypt I hallowed unto me all the firstborn in Israel, both man and beast: mine shall they be: I am the LORD.
Numbers 3:40 And the LORD said unto Moses, Number all the firstborn of the males of the children of Israel from a month old and upward, and take the number of their names. 41 And thou shalt take the Levites for me (I am the LORD) instead of all the firstborn among the children of Israel; and the cattle of the Levites instead of all the firstlings among the cattle of the children of Israel. 42 And Moses numbered, as the LORD commanded him, all the firstborn among the children of Israel. 43 And all the firstborn males by the number of names, from a month old and upward, of those that were numbered of them, were twenty and two thousand two hundred and threescore and thirteen. 44 And the LORD spake unto Moses, saying, 45 Take the Levites instead of all the firstborn among the children of Israel, and the cattle of the Levites instead of their cattle; and the Levites shall be mine: I am the LORD. 46 And for those that are to be redeemed of the two hundred and threescore and thirteen of the firstborn of the children of Israel, which are more than the Levites; 47 Thou shalt even take five shekels apiece by the poll, after the shekel of the sanctuary shalt thou take them: (the shekel is twenty gerahs:) 48 And thou shalt give the money, wherewith the odd number of them is to be redeemed, unto Aaron and to his sons. 49 And Moses took the redemption money of them that were over and above them that were redeemed by the Levites: 50 Of the firstborn of the children of Israel took he the money; a thousand three hundred and threescore and five shekels, after the shekel of the sanctuary: 51 And Moses gave the money of them that were redeemed unto Aaron and to his sons, according to the word of the LORD, as the LORD commanded Moses.
From this we see that when the firstborn of tribes other than Levi were presented to the Lord they were redeemed from service by payment of five shekels.
It is also clear that this sanctification of the firstborn applied only to the people of Israel who were not of the tribe of Levi.
From Luke’s account, we understand the following:
1. Jesus was circumcised at eight days old.
2. 40 days after birth he was taken to the Temple at Jerusalem and presented to the Lord and redeemed by a payment made to the priest.
3. A sacrifice of a pair of turtledoves, or two young pigeons was made for the purification of Mary.
Leviticus 12:1 And the LORD spake unto Moses, saying, 2 Speak unto the children of Israel, saying, If a woman have conceived seed, and born a man child: then she shall be unclean seven days; according to the days of the separation for her infirmity shall she be unclean. 3 And in the eighth day the flesh of his foreskin shall be circumcised. 4 And she shall then continue in the blood of her purifying three and thirty days; she shall touch no hallowed thing, nor come into the sanctuary, until the days of her purifying be fulfilled. 5 But if she bear a maid child, then she shall be unclean two weeks, as in her separation: and she shall continue in the blood of her purifying threescore and six days. 6 And when the days of her purifying are fulfilled, for a son, or for a daughter, she shall bring a lamb of the first year for a burnt offering, and a young pigeon, or a turtledove, for a sin offering, unto the door of the tabernacle of the congregation, unto the priest: 7 Who shall offer it before the LORD, and make an atonement for her; and she shall be cleansed from the issue of her blood. This is the law for her that hath born a male or a female. 8 And if she be not able to bring a lamb, then she shall bring two turtles, or two young pigeons; the one for the burnt offering, and the other for a sin offering: and the priest shall make an atonement for her, and she shall be clean.
Jesus wasn’t taken to the Temple to be dedicated, he was holy to the Lord by virtue of being a firstborn son in the tribe of Judah.
Jesus was taken to be redeemed from dedication.
Those who believe the gospel and are baptised into Christ are not under the Law and Covenant made with Israel at Sinai.
We are under a New Covenant in Christ which has no instructions for circumcision and redemption of the firstborn.
Nor are purification rituals and sacrifices necessary for mothers.
In Christ, children are accounted holy by the behaviour of their parents.
1 Corinthians 7:13 And the woman which hath an husband that believeth not, and if he be pleased to dwell with her, let her not leave him. 14 For the unbelieving husband is sanctified by the wife, and the unbelieving wife is sanctified by the husband: else were your children unclean; but now are they holy.
I hope you find this helpful.