Because Joseph her husband was faithful to the law, and yet did not want to expose her to public disgrace, he had in mind to divorce her quietly.
In these modern days, in my country, something about "secret/quiet" in a marriage - for example like this :
- A. A couple already engaged. Because of something, the man ---after considering--- finally decided to cancel the marriage. But in order not to expose the woman to public disgrace, the man still do the marriage ceremony, living together in a same house, but the "husband" don't do sex at all with his "wife". It's just a staged marriage so everyone else think that they are married couple as the normal husband and wife.
- B. A married couple. Because of something, the husband ---after considering--- finally decided to divorce his wife. But in order not to expose the wife to public disgrace, they still live together in the same house, but the husband don't do sex anymore with his wife. It's just a staged marriage so everyone else think that they are still a married couple.
The "considering" from the man then indirectly is also about to have sex with the woman or not to have sex with the woman.
So, in general ... a "secret/quite divorce" in my country is also about there is no sex between the couple besides other things. But still to public, the couple is a husband and wife.
Since I don't know the custom in Israel let alone during Joseph & Mary times, that's why I wonder what kind of a situation is a "secret/quite divorce" in those days ?