The gospel of St Luke is the only one to mention a reason for this. It states that Augustus Caesar issued an order that everyone should return to the city of his birth in order to pay a special tax. Joseph, Jesus's legal father, was from the town of Bethlehem and so, although his wife Mary was heavily pregnant, they had to set off for there.
The story goes that they arrived in Bethlehem to find that, with so many people coming to pay their taxes, there was no room in the inns. At the last one they tried, the innkeeper offered them a stable to sleep in. The baby was born there, and Mary laid him in the manger.
There is no historical record of any such order or census, even though the records for that place and period are meticulously kept. It is more likely that the story was developed to fit with an old Jewish prophecy that the saviour of the people would be born in Bethlehem.
The story goes that they arrived in Bethlehem to find that, with so many people coming to pay their taxes, there was no room in the inns. At the last one they tried, the innkeeper offered them a stable to sleep in. The baby was born there, and Mary laid him in the manger.
There is no historical record of any such order or census, even though the records for that place and period are meticulously kept. It is more likely that the story was developed to fit with an old Jewish prophecy that the saviour of the people would be born in Bethlehem.