And a voice from heaven said, “This is my Son, whom I love; with him I am well pleased- Mt. 3:17.
God said this in a daylight, in the presence of many people who came to be baptized by John, so that Jesus would no longer continue to be known as Son of Joseph.
God himself disclosed the truth, because he thought that people wouldn’t believe if the truth was revealed by somebody else. Therefore, we don’t need another testimony to believe Jesus is the son of God.
But a doubt might occur in some of your minds. You might say in yourself, ‘We do know Joseph wasn’t the biological father of Jesus. But God said a ruler will come from the descended of David. Didn’t God fulfil it?”
God did fulfill in two ways. In the New Testament, the genealogy of Jesus according to the Gospel of Luke traces Jesus' lineage back to King David through the line of Nathan.
Nathan-Mattatha-Menna-Melea-Ekiakim-Jonam-Joseph-Judah-Simeon-Levi-Matthat-Jorim-Eliear-Joshua-Er-Elmadam-Cosam-Addi-Melki-Neri-Shealtiel-Zerubbabel-Rhesa-Joanan-Joda-Josech-Semein-Mattathias-Maath-Naggai-Esli-Nahum-Amos-Mattathias-Joseph-Jannai-Melki-Levi-Matthat-Heli >MARY.
So Marry was also a descant of David. God enabled Joseph to accept Mary as his wife, for God didn’t not like to expose her to public disgrace.
The Gospel of Matthew traces Jesus’ lineage through Solomon.
When Joseph married Mary and took the unborn child under his protecting care, giving him the title that had come down to him through his ancestor Solomon, the Lord Jesus became his adopted son.
As the adopted son of Joseph, Jesus was the full heir of David. Matthew was concerned with Jewish law, and therefore, emphasized Jesus' inheritance from David through his adopted father Joseph.
From the two points of views the prophecy was fulfilled. Yet, Jesus is neither Joseph’ son nor Mary’s. He’s the son of God.