God intentionally lets time pass as Joseph agonizes over his circumstance. Joseph assessed the situation to the best of his natural ability: Mary is guilty of infidelity. Upset, yet merciful, he will quietly divorce her. The decision is made.
After all this, God finally intervenes:
20 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. 21 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."
The angel tells Joseph, "I know it looks like Mary did something wrong, but she did not. God is responsible for creating this messy situation. Don't be afraid to claim her as your wife. This isn't just any child; this is the Messiah. You are needed in this critical situation--because only you, as a relative of King David, can bring Jesus into the family line. "
What happens next in Matthew's gospel narrative is something I think many people miss.
It’s noteworthy that Matthew stops his narration right at this point to quote from Isaiah:
22 All this took place to fulfill what the Lord had said through the prophet: 23 "The virgin will be with child and will give birth to a son, and they will call him Immanuel"—which means, "God with us."
Sure, Matthew is saying that what's going on with Jesus' birth fulfills an Old Testament promise, but he's doing much, much more than that.
Matthew is pulling his readers aside for a moment to issue a challenge: “Listen up! Joseph has an important decision to make--and so do you: In the midst of difficult circumstances, will you believe that God sees ahead of your way? Will you trust God to work it all out?”
That was the problem facing King Ahaz in Isaiah 7 . His enemies were threatening Israel's borders, yet the Lord said through Isaiah, “Don't seek the aid of foreign armies. Trust me and me alone to protect you!” Of course Ahaz doesn't, so Isaiah gave his famous prediction in 7:14. He points to a young virgin girl and says to Ahaz, "That almah will bear a son with the name Immanuel. Anytime you see that child, it will be a living reminder that you failed to trust God."
What gets overlook is that Isaiah’s “you-watch-and-see” promise to King Ahaz about Immanuel is a sign of judgment! And yet, Matthew redeems it in his Gospel as a good news sign of promise!
The angel who visited Joseph removed a huge stumbling block by putting a divine stamp of approval on Mary’s story. As a result, the angel has essentially challenged Joseph: “You’re God’s man for this hour. Trust me. Do what God asks. God will provide."
In using Isaiah 7:14 then, Matthew is pausing to ask his readers: “In-the-line-of-David-Ahaz refused to trust God. What will in-the-line-of-David-Joseph choose? And what will you choose in the challenges you face--faith in God or your own wisdom?”
Then, at verse 24, Matthew resumes the narration. And we see Joseph's choice:
24 When Joseph woke up, he did what the angel of the Lord had commanded him and took Mary home as his wife. 25 But he had no union with her until she gave birth to a son. And he gave him the name Jesus.
Joseph chose to trust God and becomes the story’s hero. Because Joseph is in the line of David, Jesus is legally adopted into the family's heritage.
In application, if we choose the way of Ahaz, we will experience the guilt and frustration of living apart from the ever present “With-Us-God” (eg. Isaiah 8:10). But if we chose the way of Joseph, we will experience the blessing and power of the ever present “With-Us-God.”