Four Reasons
1. That the lineage of Mary might be traced through the genealogy of Joseph;
2. Lest she be stoned by the Jews as an adulteress;
3. That she might have a protector in the flight into Egypt...
4. That the birth might take place unknown to the devil who would suppose that this child was born of a wife, not of a virgin (St. Ignatius)
Below is the full unedited text of the commentary from the Traditional Breviary (1960) Matins of the Vigil of Christmas.
Homily of Saint Jerome, Priest
Book of Commentaries, on Matth. i.
Why was the Lord conceived of an espoused virgin rather than of a free? First, for the sake of the genealogy of Mary, which we have obtained by that of Joseph. Secondly, because she was thus saved from being stoned by the Jews as an adulteress. Thirdly, that Himself and His mother might have a guardian on their journey into Egypt. To these, Ignatius, the martyr of Antioch, has added a fourth reason namely, that the birth might take place unknown to the devil, who would naturally suppose that Mary had conceived by Joseph.
Reading 2
Before they came together, she was found with child of the Holy Ghost. She was found, that is, by Joseph, but by no one else. He had already almost an husband's privilege to know all that concerned her. Before they came together. This doth not imply that they ever did come together the Scripture merely showeth the absolute fact that up to this time they had not done so.
Reading 3
Then Joseph her husband, being a just man, and not willing to make her a public example, was minded to put her away privily. If any man be joined to a fornicatress they become one body; and according to the law they that are privy to a crime are thereby guilty. How then can it be that Joseph is described as a just man, at the very time he was compounding the criminality of his espoused? It must have been that he knew her to be pure, and yet understood not the mystery of her pregnancy, but, while he wondered at that which had happened, was willing to hold his peace.