"So Joseph also went up from the town of Nazareth in Galilee to Judea, to Bethlehem the town of David, because he belonged to the house and line of David."
They went to pay taxes for the census that was ordered by Caesar Augustus. Families had to register in the their historical tribal town rather than where they lived.