The decree required that each household should return to the region where their ancestors came from, and so Joseph who was from the tribe of Judah made the necessary journey. For reasons we are not told he was living in Galilee, away from his close tribal relatives, but it was not the will of God that the Lord Jesus should be born in Nazareth.
It must have been an uncomfortable journey for Mary, and Joseph may have thought that the timing of this was not at all to the family’s advantage, and strangely inconsistent with the wonderful revelations surrounding the conception. God seemed to have gone out of sight for the moment, but his unseen hand was working still. Events sweep us up sometimes and we are carried along whether we like it or not. At such times the believer can be confident that God’s will is still being done, and that some unforeseen blessing will arise out of the apparent confusion.