Mary did not engage in premarital sex. Her circumstances, to say the least, were unique (Luke 1:26-28). Many young girls got married as teenagers.
Mary went to live with her cousin Elizabeth upon hearing about her pregnancy and “stayed with her about three months, and then returned to her home” (Luke 1:56). Presumably her parents owned a home and did not throw her out when they learned of her pregnancy.
Mary and Joseph were actually married at the time she learned she was pregnant even though a formal ceremony had not taken place. Joseph is called “her husband” (Matt. 1:19).
Joseph was a self‑employed carpenter (Matt. 13:55).
An edict from the centralized Roman government forced Joseph and Mary to spend valuable resources of money and time to return to their place of birth to register for a tax (Luke 2:1-7). Joseph’s business was shut down while he took his very pregnant wife on a wild goose chase concocted by the Roman Empire to raise additional tax money.
Typical of governments that make laws without considering the consequences, there was not enough housing for the great influx of traveling citizens and subjects who complied with the governmental decree (Luke 2:1).
Mary and Joseph had enough money to pay for lodging. The problem was inadequate housing. The fact that “there was no room in the inn” (Luke 2:7) did not make them homeless. If we follow one kind of logic, any family that takes a trip is by definition homeless and finds “no vacancy” signs is technically homeless.
Joseph and Mary owned or rented a home. It was in their home that the wise men offered their gifts: “And they came into the house and saw the Child with Mary His mother, and they fell down and worshiped Him; and opening their treasures they presented to Him gifts of gold and frankincense and myrrh” (Matt. 2:11).
Joseph, Mary, and Jesus became a family on the run when Herod, a government official, became a threat to them (Matt. 2:13–15).
One could say that the Christmas story is about how taxes hurt the poor and government decrees can turn productive families into the disenfranchised by enacting and enforcing counterproductive laws.