The girl was pregnant. Her announcement hurt Joe. He was saving himself for marriage; for his fiancé, for this girl; but now this awful news.
In Joe’s community this thing would mean serious punishment for the girl. Joe’s love for her was great and he did not want her to be punished, so he considered breaking off their engagement quietly and in private; to make no issue of her condition in the community.
He thought and thought about what way to do this, and while Joe pondered it, sleep overcame him. While he slept a vision came to him: an angel told him not to dump the girl, but to go through with the wedding. The angel told him the child she was carrying was of God.
Joe did as he was told and married the girl. When the baby, a boy, was born Joseph called Him Jesus – because He came to save the world.