The deepening of faith in the virginal motherhood led the Church to confess Mary’s real and perpetual virginity even in the act of giving birth to the Son of God made man. In fact, Christ’s birth “did not diminish his mother’s virginal integrity but sanctified it.” and so the liturgy of the Church celebrates Mary as Aeiparthenos, the “Ever-virgin”.
Against this doctrine the objection is sometimes raised that the Bible mentions brothers and sisters of Jesus. The Church has always understood these passages as not referring to other children of the Virgin Mary. In fact James and Joseph, “brothers of Jesus”, are the sons of another Mary, a disciple of Christ, whom St. Matthew significantly calls “the other Mary”. They are close relations of Jesus, according to an Old Testament expression.
Jesus is Mary’s only son, but her spiritual motherhood extends to all men whom indeed he came to save: “The Son whom she brought forth is he whom God placed as the first-born among many brethren, that is, the faithful in whose generation and formation she co-operates with a mother’s love.”
From the Catechism of the Catholic Church 499-501