When Joseph learned of Mary’s pregnancy, he was “minded to put her away” (divorce her) (Mt 1:19). Why did Joseph want to divorce Mary when he had not yet married her?
According to Jewish law at that time, betrothal was considered binding, and a writ of divorce was used to break it. Infidelity in this state was considered adultery. Since Joseph was a just man, he could not possibly stay married in a case of apparent infidelity. It is noteworthy that God had to intervene to explain to Joseph that Mary was innocent, despite all appearances.