Bernard Orchard OSB, a distinguished biblical scholar, gave an interesting meditation on this topic to the Ecumenical Society of the Blessed Virgin Mary in 2001. He argued that Joseph and Mary approached their marriage just like any other devout Jewish couple, with no intention of celibacy. This is suggested by Mary's surprised response to the angel's message, which Orchard suggests must have taken place very near the end of the normal (one-year) period of betrothal "out of delicate consideration to ensure that no one might suspect that the conception of Jesus had predated the concluding nuptials." Hearing that she was to give birth to the Son of God (he would have to be divine in nature because "his kingship will have no end") she asked, "How shall this be, since I am not knowing a man?" This was not an expression of doubt, and the angel did not take it as such (compare the account of the annunciation of John to Zechariah!), but rather a request for further information. Nor was it, according to Dom Bernard, an indication that Mary and Joseph had already decided to live together as virgins. It referred only to the present moment, being in the present tense,
implying that Mary took the angel's words as promising an immediate conception. The answer "made everything clear to her; the Holy Spirit would transcend the normal process of begetting a child by taking possession of her womb and causing her to conceive God's Son without human intervention."
Mary knew herself to have conceived upon her acceptance of the angel's words, or fiat. She would have told Joseph of this almost at once. The most authoritative Greek texts, Orchard says, do not imply that Joseph doubted her word or suspected foul play, but he would certainly have wondered what to do next, since his wife had now become the equivalent of the Holy of Holies. Divorce would have been an option, but he would have had to present a good reason for it. And so, "her husband Joseph, being a just man and unwilling to make her [divine conception] public, resolved to put her away secretly" – not to divorce her, in fact, but to arrange some kind of protected seclusion. (John Lingard, in a footnote to his translation of the Gospels, does translate as "divorce privately", suggesting that this meant "without assigning the cause" and that it could be done "before those [few and intimately related] persons only who had been witnesses to their espousal.") That very night, however, the angel appeared to him in a dream to reassure him he was still to be Mary's husband in public and the legal father of the Child, thus making Jesus a Son of David according to the Law. So he received her into his house with great joy. They would have journeyed to Elizabeth's house together, but left her some months before the restoration of Zechariah's ability to speak, in order to avoid being drawn into the inevitable excitement concerning John's mission and speculation concerning the Messiah. Orchard adds a further consideration; that because the ratification of Mary and Joseph's marriage was the first ever to take place in the physical presence of Christ, we may assume that it was at this moment that Holy Matrimony became a Christian sacrament.
As indicated, this is not the only way to read Luke's account. Pope John Paul II teaches that Mary and Joseph had already accepted a vocation to virginity within their marriage. Fr Marie-Dominique Philippe does the same in his book The Mystery of Joseph. We are not compelled to believe one or the other, but Bernard Orchard's account is perhaps the more down-to-earth, and raises fewer questions concerning the validity of the marriage.
Genealogies. Dom Bernard does not discuss the genealogies in Matthew and Luke, but these also pose considerable problems of interpretation, since both trace the ancestry of Jesus back from Joseph (the legal father), one from Abraham and the other from Adam, and where they overlap the two are inconsistent. (Of course, in one way this is reassuring, since evidently no attempt has been made to tidy up the Gospel accounts and sweep discrepancies under the rug.) The reasons are manifold. In Jewish tradition not only may "son" mean "grandson" or another descendant but also, thanks to the rule whereby the next of kin was required to provide an heir for his deceased relative, a person could be the son of one man but refer to another as his father (as may have been the case with Joseph and Heli/Jacob). In addition, genealogies could be structured symbolically. Jean Danielou in his book The Infancy Narratives is quite sanguine about the fact that the Gospel genealogies contain "errors"; but errors intended to force the lists into a symbolic pattern – a form of distortion more tolerable in those days and in these forms of writing. In any case the Gospel writers clearly felt considerable freedom to select or construct a line of descent for Joseph. Matthew's genealogy from Abraham (using the word "begot" in each case) comes at the beginning of the Gospel, whereas Luke's (not using the word "begot") traces backwards from Joseph to Adam and is placed after the baptism of Jesus, which signifies a kind of rebirth; it comes immediately after the words from heaven saying "You are my beloved Son" and ends with Adam the son of God. Thus Matthew's represents the Jewish and royal ancestry of Jesus (yet making sure to include several women of ill repute and foreigners!), whereas Luke's seems focuses more on his identity as the second Adam, as befits a Gospel written for a Gentile audience.
Immediately previous articles on St Joseph may be found here and here.