Very good question! I suppose if there had been some prearranged "deal" with Joseph taking care of Mary outside of a normally understood marriage, then Mary showing up pregnant would have been a betrayal of that agreement. We don't know how long it was between the angel's announcement to Mary and Joseph's dream straightening it all out, but Scripture clearly says "before they came together Mary was found with child". Before they came together means before he took her under his roof and they consummated the marriage. He knew he hadn't fathered her child and he didn't want to make a public spectacle of her (adultery was frowned on BIG TIME), so he thought about secretly putting her away somewhere. We know he was a kind and godly man.
Again: “Hebrews under the Old Covenant like Mary and Joseph were betrothed but not yet living together.
Under Hebrew law, in this betrothed state they were allowed to have conjugal relations. But they were not yet living together as man and wife.
This is why Joseph thought to DIVORCE Mary when he found out she was pregnant, and quietly put her away or divorce her.
God would never shame a person, especially Mary, by having this miracle of the virgin birth occur in a situation where she was not legally protected by marriage and was allowed to have sexual relations in her betrothed slash married state.
Joseph understood this and also under Hebraic law, an adopted first born son is still rightfully the inheritor.
God never does things out of order. Mary and Joseph then had normal husband and wife relations and had more kids. End of story.”
The timeline...........
The timeline is simple. Once Joseph found out Mary was pregnant, he wanted to divorce her. Quietly. This meant that it everyone who saw she was pregnant in this betrothed time before they began living together, would have normally thought she was pregnant by Joseph.
There was no weirdo consecrated state going on with Mary. If there were, Mary would have not confessed she was a sinner in need of a savior in the Magnificat; and there would have been some discussion about it by the disciples themselves.
Mary and Joseph had normal sexual relations and Jesus had brothers by blood; the fact of this should have no bearing on anyone’s saving faith one way or another.
Mary would have acted the same way Paul acted when the islanders who saw that Paul didn’t die from a viper bite — wanted to worship him. Mary would also have refused veneration because it would be idolatry and remains idolatry.
How do I know? She was in the upper rooms at Pentecost, awaiting the promised gift with the rest of the disciples (including John whom Jesus told her to regard as her son and John to regard as his mom respectively).
Mary worship detracts from the worship of the one true mediator and Intercessor the Lord Jesus Christ.
Man needs no other man, living or dead, to take the place of Jesus as Mediator between God and Man.