Read the law that pertained to Mary:
Leviticus 12:5
Luke tells us she gave a sin offering:
Luke 2: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;
Mary brought two turtledoves, one for a burnt offering and one for a sin offering.
Mary was certainly a special person and should be called blessed but to think that she could have gone through life without sin would not be likely. There is no Scriptural basis at all for this.
St. Thomas Aquinas tells us: "As the fulness of grace flowed from Christ on to his Mother, so it was becoming that the mother should be like her Son in humility; for ‘God giveth grace to the humble,’ so it is written in James 4:6. And therefore, just as Christ, not subject to the Law (but born under the law: Gal 4,4), wished nevertheless, to submit to circumcision and the other burdens of the Law, in order to give an example of humilty and obedience; and in order to show His approval of the Law; and, again, in order to take away from the Jews an excuse for calumniating Him: for the same reasons He wished His Mother also to fulfill the prescriptions of the Law, to which, nevertheless, she was not subject.
"Although the Blessed Virgin had no uncleanness, yet she wished to fulfill the observance of purification, not because she needed it, but on account of the precept of the Law (“the days of [Mary’s] purification were accomplished according to the law of Moses”: Luke 2,22). Thus the Evangelist says pointedly that her purification ‘according to the law’ were accomplished; for she needed no purification in herself.
"Moses seems to have chosen his words (Aquinas is answering an objection which refers to Leviticus 12, 2-4.) in order to exclude uncleanness from the Mother of God, who was with child ‘without receiving seed’. It is therefore clear that she was not bound to fulfill that precept (Jesus having cleansed her), but fulfilled the observance of purification on her own accord, as stated above.
“The sacraments of the Law did not cleanse from the uncleanness of sin which is accomplished by grace, but they foreshadowed this purification: for they cleansed by a kind of carnal (physical as opposed to spiritual) purification, from the uncleanness of a certain irregularity…But the Blessed Virgin contracted neither uncleanness, and consequently did not need to be purified.” [Summa Theologica lll, 37, 4]
The rite of Purification of the Old Dispensation did not serve to address an imputation of sin on the soul. Mary’s Immaculate Conception and perpetual sinlessness have no connection with this Mosaic practice. The old rites cleansed people of physical impurities to allow them to participate in divine worship:
“The blood of goats and bulls and the sprinkling of a heifer’s ashes can sanctify those who are defiled so that their ‘flesh’ is cleansed.” (Hebrews 9,13)
The Church has traditionally held and implicitly defined in dogma that Mary gave birth to Jesus without any violation of her physical virginity, so there was no need for Mary to undergo the rite of Purification after giving birth to Jesus. Our Lord did not defile her flesh, having been born in a miraculous manner. But in humble obedience to the will of God, prescribed by Mosaic Law, and not unlike her divine Son who willingly submitted to the sacrament of Baptism in the Jordan river to please his heavenly Father, Mary underwent the rite of Purification.
Pax vobiscum
Good Fella