If you look in the beginning of Matthew in the KJV Joseph was going to "put away" Mary privately so she could marry whomever she had cheated on him with but she would still be responsible for the sin of adultery when she married whomever.....but the Angel talked Joseph out of doing so.that doesnt make any sense.
sorry.
"Putting Away" is not a divorce. And even though Israelite customs had several stages/levels of marriage until fully married, Mary was still married to Joseph (unconsumated....we tend to call it "engaged")
However,
Women could not access the courts or initiate a divorce. If a man divorced a woman he had to give his divorced wife the dowry her father had given him. (Usually a big chunk of money)
As a result of various circumstances, Jewish men would skip the divorce but "put away" a wife by just kicking her out of the house. He was responsible for giving her a very small amount of food and clothing....but it was so small that walking to him to collect was not worthwhile.
Jewish men were infamous for then taking advantage of these put away wives as they could have plural wives and be inside the Law.