The Catholic belief that Mary was a perpetual virgin is related to her own Immaculate Conception and Assumption and is founded on her sinlessness. She made a vow to serve God, which included a vow of virginity. The Catholic Church contends that those who claim Mary bore children other than Jesus is a huge insult, since that implies she broke her vow. The Catholic view of Mary is that she was born free of sin, and lived free of sin, for all intents and purposes, as close to being divine as a human could be.1

The earliest document the Church points to that supports this claim is the Protoevangelium of James. The fact that it was written shortly after Mary's death (between 120 and 160 A.D.) is used to strengthen the validity of the claim, although the four accepted gospels do not directly make the claim. The issue was brought up many times, and in the late 4th century, Helvidious wrote about several of his tenets, one of which was that Mary bore children other than Jesus. Saint Jerome refuted (successfully in the Church's eyes) this several times and further claimed that Jospeh was also a virgin so that Mary could keep her vow. Modern apologists claim that Jospeh was an old widower and was physically unable to have sex with Mary, and say his absence in Jesus' adult life (in the gospels) was a result of death, and as proof of his age. Others continue, claiming the children are in fact Joseph's from a previous marriage.

The claim that the gospels say Mary bore children other than Jesus is refuted by the Church based on a mistranslation of the Greek text. They say that the Greek word for brother, adelphos, has several meanings, citing other non-literal uses such as in Acts 3:17,22, Mt 7:3, 23:8, and Mt 25:40. It is usually noted that the Protestant founders (Luther, Calvin, etc.) believed in the perpetual virginity.

Relevant passages in the Catechism are:

510 Mary remained a virgin in conceiving her Son, a virgin in giving birth to him, a virgin in carrying him, a virgin in nursing him at her breast, always a virgin.

The gospels that may imply Jesus had siblings:

Is not this the carpenter's son? is not his mother called Mary? and his brethren, James, and Joses, and Simon, and Judas? - Matthew 13:55 (King James)

Is not this the carpenter, the son of Mary, the brother of James, and Joses, and of Juda, and Simon? and are not his sisters here with us? And they were offended at him. - Mark 6:3 (King James)

and the Catechism refutes this with:

500 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...

1 I must make it very clear here that the Roman Catholic Church does not believe Mary is divine. She is most definitely human. What differentiates Mary from other humans is that she is considered the model humans must strive for, but not in the same sense that Jesus is also a model. Jesus, being divine, is capable of things Mary isn't. Mary had to be redeemed, which is the goal the Church prescribes to its followers.

important disclosure: I am not a theologian, and I am an ex-Catholic (although the Church would say once a Catholic, always a Catholic). This is based on my understanding of said documents and the Catechism of the Catholic Church.