Before becoming Catholic, one of the biggest issues I had with the Church was Mary. They were borderline obsessed with her, they had all these claims about her perpetual virginity (among other things), and I didn't get it.
Fast forward three years and one confirmation into the Church, and I still have questions sometimes (although my attitude toward them has changed). Like, if Mary was a consecrated virgin then why was she betrothed to Joseph in the first place?
So let's find out together.
A lot of what the Church believes about Mary comes from the Protoevangelium of James. While it is not Sacred Scripture and we don't claim it to be, it is an important writing of the early Church.
From the Protoevangelium of James, we learn Mary's mother, St. Anne, who had been unable to have children, was told by an angel that she would conceive and her "seed shall be spoken of in all the world." After hearing this, St. Anne told the angel that she would consecrate her child to God.
When Mary was three, she was brought by her parents to the Temple of God to live and serve there. As a continual servant of the Lord, Mary would not be able to marry or have children. Rather, she was a consecrated virgin.
When Mary was twelve, the high priests discerned that she should be entrusted to Joseph, a widower. "Due to considerations of ceremonial cleanliness, it was eventually necessary for Mary, a consecrated "virgin of the Lord," to have a guardian or protector who would respect her vow of virginity. Thus, according to the Protoevangelium, Joseph, an elderly widower who already had children, was chosen to be her spouse. (This would also explain why Joseph was apparently dead by the time of Jesus’ adult ministry, since he does not appear during it in the gospels, and since Mary is entrusted to John, rather than to her husband Joseph, at the crucifixion)." (Catholic Answers, "Mary: Ever Virgin")
When she was sixteen years old, an angel came to her and told her that she would conceive Jesus by the Holy Spirit. When the priests discovered that Mary was pregnant, she and Joseph were accused of sin but eventually found innocent. When the time came for Mary to give birth to Jesus, a cloud shadowed the cave she was in and a bright light shone so that no one could see anything until he had been born.
While the Protoevangelium is recognized for its embellishments and is not considered authoritative, it reflects the early Church's understanding of & attitude toward the perpetual virginity of Mary. Other sources that defended Mary's perpetual virginity include: Origen, Athanasius, Epiphanius of Salamis, Jerome, Didymus the Blind, Ambrose of Milan, Pope Siricius I, Augustine, Leporius, Cyril of Alexandria, Pope Leo I, Martin Luther, John Calvin, and Ulrich Zwingli (Catholic Answers, "Mary: Ever Virgin").
So, to answer our question, Mary was betrothed to Joseph because, according to the customs of the time, she needed someone to care for her. A true marriage was never intended -- something I had never considered as a Protestant -- which is why her sudden pregnancy created such a scandal and yet was so plainly miraculous. Understanding things in this light changes everything.