First, because it refers to “a” messiah. Not “The” Messiah. The teaching, recorded in tractate Sukkah, makes reference to two messiahs. One is Mashiach ben Yosef (“Messiah son of Joseph”). The other is Mashiach ben David.
The former is the son of Joseph (son of Jacob, not Joseph and Mary). He is viewed as a kind of forerunner to the Davidic Messiah and he has a specific mission. His specific role was to defeat the power of “Esau,” Jacob’s brother. In Jewish tradition, Esau is a figure for Rome. This is based on a reading from the prophet Obadiah, who states that “the house of Jacob will be fire, the house of JOseph a flame, and the house of Esau for straw; and they will ignite them and devour them. There will be no survivor to the house of Esau, fo rthe Lord has spoken.”
So, since Jesus was not from the house of Joseph, he could not be the messiah referred to in the Talmud. ANd since he did not even attempt to upset the power of Rome, he could not be the messiah ben joseph.
Although it is certainly true that most of the details of Messiah ben Joseph in the Talmud don’t match with the life of Jesus, there are certain striking parrallels.
Roy H. Schoeman writes about this extensively in his book,
Salvation is from the Jews
The mission of Messiah ben Joseph was to be
defeated, and in particular, peirced, by his enemies.
The following passage from the Talmud identifies Zechariah as talking about Messiah ben Joseph: “What is the cause of the mourning in Zechariah 12:10]…The cause is the slaying of Messiah the son of Joseph” -
Sukkah 52a
Joseph Klausner , a Jewish Talmudic scholar, writes that “the idea of the ‘suffering servant’ has its source in this verse of Zechariah together with Isaiah 53”
Zechariah 12:10 And I will pour upon the house of David, and upon the inhabitants of Jerusalem, the spirit of grace and of supplications:
and they shall look upon me whom they have pierced, and they shall mourn for him, as one mourneth for his only son, and shall be in bitterness for him, as one that is in bitterness for his firstborn. (KJV)
Other reasons exist for connecting Jesus with the Messiah ben Joseph.
Like Joseph, he was falsly condemned for a crime exactly opposite to his virtue. Joseph was condemned for attempted rape precisely because he refused to sleep with Potiphar’s wife. Jesus was condemned for blasphemy precisely because he WAS G-d’s son.
Additionally, the final result of Joseph’s brothers selling him into slavery and attempting to kill him was that “all the earth” (Gen. 41:57) was saved from death.