If Y'shua is Mashiyach bin Yosef, how can he have been born of a virgin?
In order to be descended from David through Yosef, Y'shua would have to have been a son of Yosef, not just of Mariam. The two genealogies (in Matthew and in Luke) both trace through Yosef, but do not agree even as to Y'shua's paternal grandfather.
How can Y'shua be a son of David, a descendant of David, if he was not, as Paul says, naturally descended "according to the flesh" from David? (Romans 1:3).
The careful Bible student is likely to conclude that Matthew and Luke present two different genealogies. Following through the genealogies, one will notice that there are some names which are common to both, but also, a great number of differences.
Matthew begins at the patriarch Abraham, and works his way to Yeshua the Messiah. Luke begins at Yeshua, and works his way back to Adam. There are two genealogies, with two distinct purposes. Matthew, it appears reveals the genealogy of Joseph, and Luke, presents the genealogy of Mary.
Matthew, penning his gospel with the Jews in mind, sets out to establish Yeshua's qualifications to be the Messiah through Joseph's genealogy. Thus, beginning with Abraham, he maps the Lord's genealogy through David, and the kings which followed. He presents Jesus' royal lineage (through the males) through "...Joseph, the husband of Mary, of whom was born Yeshua..."
Luke, writes to the Gentiles with a view toward the humanity of Messiah. The concept of one being both God and man would seem strange and foreign to those accustomed to Greek and Roman gods. Thus, Luke begins at Yeshua, and follows the genealogy of Mary, passing through the patriarchs, ending with the very first man, Adam.
If Luke is tracing the genealogy of Mary, why does he cite Joseph's name? Today, it would be politically incorrect to map a woman's genealogy through her husband, however, in Luke's day, it was proper and correct. Luke follows Mary's genealogy, beginning with the name of Joseph, her husband, Heli's son-in-law (in legal terms, his son by marriage).
How can Yeshua have a genealogy without having a biological father? Very simply, in legal terms, Joseph was Yeshua's father (look at it as a step-son who has all the rights and privileges of an adopted son). Thus, the genealogy of Joseph was legally applied to Yeshua.
See a more indepth response at Yeshua's qualifications.
Also, please read these articles: