He went with Mary, who was engaged to him and who was expecting a child.
Around this time Caesar Augustus made a law that required everyone in the whole Roman world to register for taxation and military service.
Everyone had to go to their own hometown to register.
Because Joseph was from the family line of David, he went from Nazareth in Galilee to Judea so he could register there in Bethlehem, the town of David.
While they were there, the time came for the baby to be born.