As a woman of the time, Mary had very limited options. She would be judged harshly and condemned for her supposed immoral behavior. Due to public opinion, even her own family would not be able to help her.
Joseph showed his extreme kindness in his initial reaction to divorce her quietly. I am sure he felt betrayed and embarrased, but he did not punish Mary for it. When God revealed His plan to Joseph, he did not argue or question. He was a man of great faith.