I believe the O.P.'s question can be interpreted as, “Why is belief in Mary’s perpetual virginity considered so important that the Church makes it an excommunicable offense (heresy) to deny it?”
The first observation to make is that all Marian dogmas have their root in the fundamental Marian dogma, which is that she is Theotokos, the Mother of God. This extraordinary grace exalts Mary—in the order of grace—over all other creatures, even the angels. Only Jesus Christ, who is hypostatically united to the Word is more “full of grace” than she. (See Catechism of the Catholic Church [CCC] 498.)
The dogma of the Theotokos would not have so much importance in itself if it did not follow as a direct consequence of the Hypostatic Union and the so-called communion of properties. Mary can be rightly called Mother of God precisely because Jesus Christ’s human nature is so closely united to the Word (that is, the Divine Person of the Son), that his human actions and states are rightly attributed to his Divine Person. It is perfectly orthodox to say that God—that is, the Divine Son—was born of a woman; grew up in Nazareth; ate, drank, spoke, and laughed; died on a cross; and rose from the dead. For this reason, Mary is rightly and properly called Mother of God. This is, in fact, the solemn teaching of the Council of Ephesus, A.D. 431. The Council Fathers reasoned that, in effect, if they denied Mary the title of Mother of God, they would be denying Jesus’ complete unity as a Person. (See CCC 466.)
In teaching the perpetual virginity Mary, the Church is in no way belittling the beautiful vocation of marriage, nor is she suggesting, in the slightest way, that the marital act and the begetting of children is in any way evil.
However, the Divine Motherhood of Mary forges a special relationship between Mary and the Holy Spirit, which the Scriptures strongly suggest was meant to be exclusive.*
For example, there was no particular reason why the Incarnation could not have occurred by means of the normal process of human generation. The consummation of marriage and the procreation of children are far from sinful, and God could easily and fittingly have used these means to achieve His ends.
However, in fact—as all orthodox, Nicene Christians agree—He chose the even more excellent step of being born to a virgin—that is, without making use of the carnal union. Again, that is not because the carnal union is evil, but because the Virgin Birth is a more manifest sign of the immensity of the Incarnation. (As I am sure the O.P. is aware, the Scriptures abundantly bear witness to the Virgin Birth—to the fact that Joseph was not Jesus’ biological father—especially Luke 1 and Matthew 1.)
The Holy Spirit, by “overshadowing” Mary (see Luke 1:35) with His power, effectively consecrated Mary and her womb to Himself. Again, it was not necessary for God to ask Mary to refrain from consummating her marriage after the Virgin Birth (just as it was not necessary for the Incarnation to take place by means of a virginal conception, and just as it was not strictly necessary for our salvation for God to become incarnate at all). It was, however, most fitting that the womb, once consecrated to God, should remain for Him alone.
Finally, there is also the simple matter of fact. The perpetual virginity of Mary is a historical fact, whose truth or falsehood depends not on theological speculations, but on Mary’s actual condition when she was on the earth. Either she consummated her marriage with Joseph, or she did not. The testimony of the Church Fathers on this question, however, is unanimous. They called her Aeiparthenos, the Ever-Virgin (see CCC 499). As witnesses we might mention the Protoevangelium of James (c. 145 A.D.), a non-Canonical but pious book from the second century; Origen of Alexandria; Hilary of Poitiers; Athanasius; Epiphanius of Salamis; Jerome; and son. (See the article on the perpetual virginity of Mary from Catholic Answers for actual excerpts from the Fathers.)
In other words, the Church affirms the dogma for the simple reason that it corresponds to historical reality.
It should be mentioned that although the Church maintains Mary’s virginity before, after, and even “even in the act of giving birth to the Son of God made man” (CCC 499), the Church does not insist on teaching that the virginity is a physical one (as if the birth of our Lord had no effect on Mary’s body; e.g., that she did not suffer from the pains of childbirth). There is a pious tradition to that effect, but it is not part of the faith.
* At the request of Jon the Architect, here are some other references to the Scriptures that help paint the picture that relationship of Mary to the Holy Spirit was exclusive. (Please note that I said that the Scripture suggests this, without being explicit. The definitive justification for the dogma comes from Sacred Tradition—i.e., the witness of those who knew Mary and Jesus, whose testimony was passed on orally.)
Mary asks the angel how the birth of the Messiah is to take place. (Luke 1:34.) Since Mary is already engaged to be married to Joseph (Luke 1:27), that would be a strange question if she were not intending to remain a virgin.
In all of the Old Testament, the places in which God has a special presence are deemed inviolable: the Holy of Holies of the Temple (especially when God appeared in the cloud there; see, e.g., Leviticus 16:2), the Ark of the Covenant (2 Samuel 6:6-7), theophanies like the Burning Bush (Exodus 3:4), and so forth. None of these presences, however, comes anywhere near the extraordinary presence of God that came to be at the Incarnation. It is likely that Joseph (a faithful Jew steeped in the Old Testament Scriptures) would have feared to consummate his marriage with Mary for this reason.