No, the Bible's narrative about the Virgin Mary and the birth of Jesus is not a legend - not at all. In fact, the Bible's most extensive account about Mary was written by Luke, who was a physician, and therefore knew that the virgin birth of Jesus was impossible apart from God.
And that points to one reason why Jesus was born of a virgin: to show that He was sent into the world by God. His was no ordinary birth - because He was no ordinary human being. He wasn't just another man - not even a great one. He was God in human flesh, sent from heaven to save us from our sins. As the angel told Joseph, "Do not be afraid to take Mary home as your wife. ... She will give birth to a son, and you are to give him the name Jesus (which means 'the Lord saves'), because he will save his people from their sins" (Matthew 1:20-21).
Jesus was also born of a virgin to fulfill a prophecy that was given hundreds of years before: "Therefore the Lord himself will give you a sign: The virgin will be with child ... and will call him Immanuel (which means 'God with us')" (Isaiah 7:14). Jesus' virgin birth confirms that He was that promised Savior.
The most important fact, however, about Jesus' virgin birth is this: Because Jesus Christ came into the world, you and I can have our sins forgiven and go to be with Him someday in heaven. Put your faith and trust in Him today.