Matthew J. Marohl's book, Joseph's Dilemma: 'Honor Killing' in the Birth Narrative of Matthew, is a very provocative one. His thesis is that whether the birth narrative in Matthew depends on a possible honor killing motif depends upon whether Joseph suspected Mary of adultery.” (pp. 23-24) He goes on to argue that the clear majority of modern interpreters think Joseph suspected Mary of adultery.” (p. 24). So Joseph’s desire to put Mary away privately when he discovered she was pregnant was not to keep her from shame, but rather to defend him and his family’s honor based on OT texts like these:

If any man takes a wife and goes in to her and then turns against her, 14 and charges her with shameful deeds and publicly defames her, and says, ‘I took this woman, but when I came near her, I did not find her a virgin,’ 15 then the girl’s father and her mother shall take and bring out the evidence of the girl’s virginity to the elders of the city at the gate. 16 "And the girl’s father shall say to the elders, ‘I gave my daughter to this man for a wife, but he turned against her; 17 and behold, he has charged her with shameful deeds, saying, "I did not find your daughter a virgin." But this is the evidence of my daughter’s virginity.’ And they shall spread the garment before the elders of the city. 18 "So the elders of that city shall take the man and chastise him, 19 and they shall fine him a hundred shekels of silver and give it to the girl’s father, because he publicly defamed a virgin of Israel. And she shall remain his wife; he cannot divorce her all his days. 20 "But if this charge is true, that the girl was not found a virgin, 21 then they shall bring out the girl to the doorway of her father’s house, and the men of her city shall stone her to death because she has committed an act of folly in Israel, by playing the harlot in her father’s house; thus you shall purge the evil from among you. (Deut. 22:13-21).

If a priest’s daughter defiles herself by becoming a prostitute, she disgraces her father; she must be burned in the fire (Leviticus 21:9)

"And he that curses his father, or his mother, shall surely be put to death. (Exodus 21:17)"

"For every one that curses his father or his mother shall be surely put to death: he hath cursed his father or his mother; his blood shall be upon him. (Leviticus 20:9)"