When Joseph woke from his dream, he willingly obeyed God and took Mary home to be his wife, in spite of the public humiliation he would face. Perhaps this noble quality is one of the reasons God chose him to be the Messiah's earthly father.
Joseph too must have wondered in awe as he remembered the words found in Isaiah 7:14, "Therefore the Lord himself will give you a sign: The virgin will be with child and will give birth to a son, and will call him Immanuel." (NIV)
At that time, Caesar Augustus decreed that a census be taken, and every person in the entire Roman world had to go to his own town to register. Joseph, being of the line of David, was required to go to Bethlehem to register with Mary. While in Bethlehem, Mary gave birth to Jesus. Probably due to the census, the inn was too crowded, and Mary gave birth in a crude stable. She wrapped the baby in cloths and placed him in a manger.