Joseph also went up from Galilee, out of the city of Nazareth, into Judea, to the city of David, which is called Bethlehem, because he was of the house and family of David;

 If that was the case in Egypt, it may well be that in Judaea, where the old tribal ancestries still held good, men had to go to the headquarters of their tribe. Here is an instance where further knowledge has shown the accuracy of the New Testament. 