This is how the birth of Jesus Christ came about: His mother Mary was pledged to be married to Joseph, but before they came together, she was found to be with child through the Holy Spirit. Because Joseph her husband was a righteous man and did not want to expose her to public disgrace, he had in mind to divorce her quietly. But after he had considered this, an angel of the Lord appeared to him in a dream and said, “Joseph son of David, do not be afraid to take Mary home as your wife, because what is conceived in her is from the Holy Spirit. She will give birth to a son, and you are to give him the name Jesus, because he will save his people from their sins.” All this took place to fulfill what the Lord had said through the prophet: “The virgin will be with child and will give birth to a son, and they will call him Immanuel” -which means, “God with us.” When Joseph woke up, he did what the angel of the Lord had commanded him and took Mary home as his wife. But he had no union with her until she gave birth to a son. And he gave him the name Jesus. Matthew 1:18-25

Were Joseph and Mary two teenagers in love? Or as was often the case in Israel at that time, was he an older man who had established himself and now needed a bride to start a family? The Bible does not say, and opinions vary.
But Matthew clearly states that Joseph was a righteous man. This phrase does not mean that he was sinless, but that he followed the Mosaic law as much as humanly possible, presented sacrifices when he couldn’t keep it, and had faith in God.
Can you imagine his thoughts and feelings when he saw that his betrothed was pregnant? He knew he wasn’t the father. He could only assume that Mary had been unfaithful. Joseph had the right under Mosaic Law to have her put to death for adultery. So why didn’t he?
Possibly he didn’t want his shame as a cuckolded husband to become public knowledge. Better that people think he and Mary just were incompatible. They just had irreconcilable differences, the marriage was irretrievably broken, as we would say now. But I don’t think so.
Joseph was a wise choice. For although he tried to keep the law, he also had compassion. He did not want Mary to face public shame and capital punishment, so he decided to handle the matter quietly.
But God intervened. He sent the angel in a dream to quiet Joseph’s troubled heart and mind, and Joseph believed.
So he took Mary into his home, without the traditional wedding feast and public celebration. He gave her refuge and protection. He became the earthly step-father to her son, the Son of God. He raised Jesus and taught him the carpenter trade.
Legally, Jesus was Joseph’s son and heir. Just as today, a child born in wedlock is considered to be the legitimate offspring of the husband, so also was Jesus’ relationship to Joseph. Not only was Jesus a physical descendant of David through His mother Mary, but he was also the legal son and heir through Joseph’s descent from the line of Israelite kings listed in Matthew 1, from David to Solomon, through to Jeconiah who was exiled to Babylon. Later Joseph’s ancestor Zerubbabel returned to the land.
God chose just the right people to be His Son’s earthly parents.
What would it look like if Jesus were born tonight? https://www.youtube.com/watch?v=W-QCTWVJfmk