mary had very little options .at this point in time women were totally dependent on men for survival,. marriage was the way to a secure future unfortunately being pregnant and not yet married was a crime punishable by death (stoning) or being shunned by all family and society. since women had no careers then all that would be available for someone so disgraced would be servanthood or prostitution.the shame and stigma attached to this transgression was total. joseph being a righteous man must have desired to act in keeping with the law especially as it must have seemed to him that he had been made a fool off by his promised bride.but even if his pride and honor was attacked he still cared enough for mary to consider the disgrace she would face. so he decided to spare her the dishonor and just put her aside gently on other pretext by releasing her through a quiet divorce. i would say joseph was most gracious inspite of the circumstances he faced and tempered justice with love