Ahaz was facing a military threat in the alliance of Israel and Syria, and scrambling to make alliances of his own. The prophet is trying to tell him that God will protect Judah without the help of a foreign alliance. Isaiah tells Ahaz to ask for a sign. Ahaz responds that he will not put God to the test.
His response is disingenuous. Kings asked God for signs all the time. It is part of what the priesthood existed for. Ahaz didn’t want an inconvenient answer, one that ran against his own presuppositions. When Isaiah provides a sign, it is in fact a hopeful sign, not the usual doom presented by the prophets: See that young woman there? By the time the child is weaned and knows right from wrong, Israel and Syria will be deserted. You need not fear.
How often do we ask for a sign and then disbelieve it when given, because it wasn’t the sign we wanted or expected? Joseph, on the other hand, receives a sign without asking, and believes it. According to Deuteronomy 22, he had the right to have her stoned (after a public trial), but opts to dissolved the engagement quietly, though her life would still have been over in other ways.
Instead, an angel shows up in his sleep and tells him to take Mary as wife. Matthew uses the device of an angel in a dream more than once, particularly with Joseph, making him like his namesake in the stories of the patriarchs. Matthew clearly sees the connection between the great epic of Israel’s captivity in Egypt and exodus. He even references Jesus’ name as the new Joshua (he will save his people).
Matthew takes the embarrassing fact of Jesus’ illegitimacy (Mark hardly addresses it, leaving without comment the crowd calling Jesus ‘the son of Mary,’ a clear reference to her questionable status) and weaves it into his story which recapitulates Israel’s story. His genealogy of Jesus mentions Tamar (who played the harlot with Judah to force him to give her in marriage to another of his sons), Rahab the prostitute, Ruth, who seduced Boaz at the threshing floor, and Bathsheba (calling her only Uriah’s wife). And Mary.
Whatever the gossip about Mary, Matthew takes her pregnancy as a sign of God’s presence with us. I wonder if Matthew intended to show that God is with us through an application of charity and righteousness (Joseph was a righteous man) rather than of the letter of the law. In the Sermon on the Mount, Jesus repeats the formula, “You have heard it said to those of old . . . But I say to you . . .” and reinterprets the law toward charity and inclusion in the community, rather than drawing its boundaries sharply. This would certainly fit with his overall program of making the law practicable by Gentiles. Joseph becomes the archetype of the new Christian, and the angel who speaks to him a sign for us as well, to include those who would otherwise come in for blame and punishment.