NKJV - 25 And did not know her till she had brought forth her firstborn Son. And he called His name JESUS.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
Jesus had to be born of a virgin so that his will can be carried out like he had planed. If Mary and Joseph did know each other then the people would not believe that Jesus is the Messiah.