peace,
The original Greek is “καὶ οὐκ ἐγίνωσκεν αὐτὴν ἕως οὗ ἔτεκεν τὸν υἱὸν” (and he knew her not until she bore a son").
Now, that word ἕως (“heos”) is what’s in play here. As others have mentioned, Catholic apologists have explained the meaning of that word in detail. One example that I like to use, comes from the Old Testament. In the story of David and his first wife (Michal), the Bible helps us see the way that ‘heos’ is used:
“As the ark of the LORD was entering the City of David, Michal, daughter of Saul, looked down from her window, and when she saw King David jumping and dancing before the LORD, she despised him in her heart… Michal, the daughter of Saul, came out to meet him and said, ‘How well the king of Israel has honored himself today, exposing himself to the view of the slave girls of his followers, as a commoner might expose himself!’ But David replied to Michael, ‘I was dancing before the LORD… I will be lowly in your eyes, but in the eyes of the slave girls you spoke of I will be somebody.’ Saul’s daughter Michal was childless to the day she died.” (see 2 Samuel 6)
Now, in the Greek of the Septuagint Bible, this last sentence is “καὶ τῇ Μελχολ θυγατρὶ Σαουλ οὐκ ἐγένετο παιδίον ἕως τῆς ἡμέρας τοῦ ἀποθανεῖν αὐτήν”. Do you see it? The word ‘heos’ – which means ‘until’ or ‘to’ – is here! Now, let me ask you a question: if Michal was childless ἕως the day of her death, does that imply that she had a child after she died? Likewise, if Mary did not have relations with Joseph ἕως she bore a son, does that imply that she had relations with him afterward?
Of course it doesn’t! And, just to help put some context around our discussion, let’s look at what Matthew was trying to say: he was writing to a Jewish Christian audience, and from a Jewish perspective, the criticism was “son of God? Are you crazy? We knew him in his hometown – he’s the son of Joseph, you fools!” So, Matthew wants to demonstrate that (1) Jesus was conceived of the Holy Spirit, not of Joseph and (2) there’s no way that Joseph could have been Jesus’ natural father. So, that’s why he frames it up the way he does!
Hope that helps!
Blessings,
G.