Because Joseph her husband was faithful to the law and didn't want to expose Mary to public disgrace, he had in mind to divorce her quietly.