Couple of things.

1st Joseph is instructed to take Mary home as his wife.

2nd, there is  a possibility that Joseph may have later married his dead brother's wife, to raise up posterity for his brother. After Joseph's death, the "other woman" may have married Cleopas, the two noted, on the road to Emmaus. For those people, that would give Jesus siblings, & Mary a sister.