Luke's Gospel tells most of the story. When Jesus was born, the Roman Empire ruled most of the Middle East. The Government wanted every single family to have their name taken down to be taxed, so everyone had to go back to the place where they came from. Joseph came from the small town of Bethlehem, near Jerusalem, so even though Mary was close to giving birth to her baby, they had to travel, with thousands of other people.