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.
He was not born in a manger, he was placed in a manger. He was wrapped in swaddling clothes and placed in the manger - a place for holding the animals' food. A symbol of becoming the bread of life. To not only feed God's word to the world but to become life itself by sacrificing himself upon the cross.
Jesus, our Holy Lord Jesus, was born in a manger because He is GOD, Emanuel, GOD with us.
All glory, honor, majesty, and praise are His, Rev 7:12, not His surroundings (as would be the son of an earthly king in some plush palace surroundings).
That is why heavenly angles were sent to announce His arrival, Luke 2:9-14, by Almighty wisdom, to shepherds, as Jesus is our Shepherd, and not by simple human carolers.
The same applies when our Holy Lord Jesus rode a colt of a donkey into Jerusalem, Luke 19:30. All glory, honor, majesty, and praise are His, not what he is riding (as would some earthly king coming in on some glorious golden chariot, drawn by magnificent stallions).
Always pray to our Father in Jesus name, John 7:14, and ask for understanding when you are having problem understanding God’s Word, and pray for your daily bread (the Holy Living Word of God, Jesus, the Bread of Life).
Thank you Jesus
Another fine example of humility I believe.