“Love the Lord with all your heart, and with all your soul,
and with all your MIND”--Matt 22:37
Short answer: because "all have sinned" doesn't mean, literally "all". We know that there are exceptions--one big one would be, of course, Jesus Christ Himself. And, of course, there are millions of other exceptions to the "all have sinned" verse: all the little babies and wee ones younger than the age of reason (about age 7). We know that they can't sin until they make a free choice to sin.
So if there are millions of exceptions, why couldn't Mary be another exception?
Thus, we can see that belief in Mary's sinlessness in no way contradicts Scripture, in particular, Romans 3:23.
In fact, if anyone wants to argue that "all have sinned" is, literally, every single human being, then this person will have a difficult time convincing a Muslim that Jesus is divine...for all the Muslim has to do is say, "Well, even your own holy Bible declares that Jesus sinned--does it not say that 'all have sinned'?" and the only response for this person would be to admit, yes, all have indeed sinned, including Jesus.
A Catholic, however, is in good position to provide apologia to a Muslim for he can say: "We don't believe that 'all have sinned' means a literal every single human being." And thus, we can confidently assert to this Muslim that Jesus was divine and that our Scriptures do not declare that He sinned.
Incidentally this Sunday's Gospel from Matthew proclaims another example of "all" not meaning, literally, every single human being:
At that time Jerusalem, all Judea,
and the whole region around the Jordan
were going out to him
and were being baptized by him in the Jordan River
as they acknowledged their sins.--Matt 3
We know that, in fact, not every single person in Judea was baptized by John the Baptist. This is confirmed in the Gospel of Luke which declare that the Pharisees in Judea were never baptized by John the Baptist:
(All the people who listened, including the tax collectors,
and who were baptized with the baptism of John,
acknowledged the righteousness of God;
but the Pharisees and scholars of the law,
who were not baptized by him,
rejected the plan of God for themselves)--Luke 7
Thus, we can see that "all" does not necessarily mean "all".
Thank God for the Church, through whose divinely assisted wisdom we can be guided into reading His Word with the proper understanding! Without her guidance we are predisposed to erroneous interpretations, being "tossed to and fro by the waves and carried about by every wind of doctrine, by human cunning, by craftiness in deceitful schemes."--Ephesians 4:14
Rather, we, the flock, are shepherded into knowing when to take the Word literally, when it is symbolic and metaphorical, when it is binding, when it is loosing, etc etc etc, without being subdued and conquered by the waves and winds of false interpretations.
As the magisterium of our Church states:
But the task of authentically interpreting the word of God, whether written or handed on, has been entrusted exclusively to the living teaching office of the Church, whose authority is exercised in the name of Jesus Christ. This teaching office is not above the word of God, but serves it, teaching only what has been handed on, listening to it devoutly, guarding it scrupulously and explaining it faithfully in accord with a divine commission and with the help of the Holy Spirit, it draws from this one deposit of faith everything which it presents for belief as divinely revealed.--Dei Verbum, Dogmatic Constitution on Divine Revelation
For more in-depth study visit these websites:
"Always be prepared to give an answer to everyone who asks you to give the reason for the hope that you have. But do this with gentleness and respect" - 1 Peter 3:15