
According to the Gospel of Matthew, Joseph learned that Mary was found to be pregnant after she was pledged to marry him, but before the marriage had been consummated.
As Thomas Nelson explained in The King James Study Bible, this had potentially deadly implications for Mary according to Jewish custom:
“Her pregnancy naturally would have been assumed to be the result of an illegitimate union of adultery, a circumstance punishable by death (Deut. 22:23, 24).”
However, as the King James Bible relates:
“Then Joseph her husband, being a just man, and not willing to make her a publick example, was minded to put her away privily.”
In this context, “put her away privily” means to divorce her privately: i.e., secretly. (See the translation details at King James Bible Online.)
As the 19th-century theologian Barton W. Johnson explained:
“To put her away publicly was to expose her to the penalty of death.”
Joseph, it seems, sought to divorce Mary secretly so as to spare her from capital punishment.
Matthew the Apostle claimed that this intention indicated that Joseph was “a just man.”
Several translations and commentaries interpret the use of “just” in the above verse (Greek: dikaios) as referring to Joseph’s plan to comply with the requirement to divorce in cases of adultery. For example, the 18th-century theologian John Wesley interpreted “a just man” in this context as:
“A strict observer of the law: therefore not thinking it right to keep her.”
However, I wonder if Matthew meant that it was Joseph’s non-compliance with the custom of killing women over adultery that marked him as just. Joseph defied a human law (or, rather, a convention) for the sake of obedience to a genuinely divine law: “thou shalt not murder,” as expressed by the Sixth Commandment received by Moses of God.
This would be consonant with the multiple times that Jesus condoned non-compliance with traditional and written Jewish conventions in spite of the castigation of the Pharisees, members of a sect that insisted on strict observance of such conventions.
For example, the Pharisees resolved to destroy Jesus after witnessing him miraculously heal a crippled man on the sabbath day, because they considered it a violation of the prohibition against work on the sabbath. (Matthew 12:10-14)
And earlier that day, they objected on the same grounds when they saw Jesus’s disciples in a grain field picking heads of grain and eating them when they were hungry.
“Behold,” they protested to Jesus, “thy disciples do that which is not lawful to do upon the sabbath day.” (Matthew 12:2 KJV)
But Jesus defended both acts—the healing and the harvesting—and told the Pharisees, citing the prophet Hosea:
“But if ye had known what this meaneth, I will have mercy, and not sacrifice, ye would not have condemned the guiltless.”
Joseph, it would seem, did know what that meant. And so he chose mercy over sacrifice by refusing to condemn Mary, the mother of Jesus, to death.
This would have demonstrated Joseph’s adherence to true justice, even if Mary had been guilty of adultery. And as he soon learned, his betrothed was, in truth, guiltless, which doubly vindicated his mercy:
But while he thought on these things, behold, the angel of the Lord appeared unto him in a dream, saying, Joseph, thou son of David, fear not to take unto thee Mary thy wife: for that which is conceived in her is of the Holy Ghost.
And she shall bring forth a son, and thou shalt call his name JESUS: for he shall save his people from their sins.