Which is why Mary and Joseph had to travel from Nazareth to Bethlehem in the ninth month of her pregnancy. They had to make that long and dangerous journey because Bethlehem was Joseph's ancestral hometown—a fact they knew from studying their genealogy.
I. Why This Passage Is Important Today
You may readily grant all that I have said and still wonder why we should study this passage. Although it was important 2000 years ago, what relevance does it have today? Let me suggest three answers to that question. 
A. It establishes Jesus as part of the royal family of David.
This is no doubt the central purpose of Matthew 1:1-16. To a skeptical Jewish reader, no question would be more central in his mind. God had said 1000 years earlier that the Messiah must come from the line of David (II Samuel 7). In the time of Christ, Jesus wasn't the only one claiming to be the Messiah. Other men—imposters—claimed to be Israel's Messiah. How would the people know who to believe? One answer: Check his genealogy. If he's not from the line of David, forget it. He can't be the Messiah.

That's why Matthew 1 begins this way: "A record of the genealogy of Jesus Christ, the son of David, the son of Abraham." David is listed first, even though chronologically Abraham came first in history. Why? Because the crucial issue was not, "Is Jesus a Jew (a son of Abraham)?" but rather, "Is he a direct descendant of David?" In order for Jesus to qualify as the Messiah, he must be a literal, physical descendant of David.

We can see the same principle at work in the recent controversy concerning Prince Charles and Princess Diana. This week Buckingham Palace announced that they were separating—a prelude to a possible divorce. Beyond the personal tragedy involved lies a much greater constitutional crisis for the royal family. Because the sovereign is also the head of the Church of England, no divorced person may sit on the throne. When Queen Elizabeth steps down, who will take her place? Prince Charles is next in line, but if he is divorced, he can't take the throne. Who is next in line? Genealogy gives the answer. The oldest child of Charles and Diana would be second in line, their second son would be third in line. But the monarchy itself has been called into question by this crisis. The rulers of England must come from the house of Windsor, and those rulers are determined strictly by genealogy.

The same is true for Jesus Christ. His "right to the throne" is determined by his genealogy, which establishes beyond question that he is indeed a literal descendant of King David.
B. It demonstrates that Jesus Christ had historical roots.
Galatians 4:4 says, "But when the time had fully come, God sent his Son, born of a woman, born under the law." The italicized phrase has the idea of fruit ripening for the moment of harvest. That is, when God had perfectly prepared every detail of history, he sent his Son into the world. Historians have known for years that at the time of Christ, there was a widespread expectation that "something" was about to happen. The now-extinct religions of Greece and Rome held out hope that a deliverer would come from heaven. The Jews themselves knew that the Messiah would come according to the prophecies. The Persians studied the heavens and knew the time was at hand. There was a desire, a hope, a yearning, a deep feeling throbbing in the heart of humanity that someone must appear who would radically change the world.

No, they weren't consciously expecting Jesus, but the yearning was undeniably there. And into that expectant world God sent his Son. At just the right time. In just the right way.

Matthew 1 is telling us that Jesus Christ had roots. He had a family tree. He didn't just drop out of heaven, he didn't appear magically on the scene, but at the perfect moment of history, Jesus was born in Bethlehem.