Is chastity only expressed in virginity? Blessed Alexandrina da Costa of Balasar


  On Holy Saturday of 1918, while Alexandrina, Deolinda and a young
  apprentice were busily sewing, three men violently entered their home
  and attempted to sexually violate them. To preserve her purity,
  Alexandrina jumped from a window, falling four metres to the ground.


Also 


  Like St Maria Goretti, she was ready to die rather than consent to the
  man's lustful advances.


I'm sure there is more women who were saints and had similar story.
My question is how does a woman who is raped or forced to an unwanted impure act lose her purity? Does only a virgin keep her purity intact? I personally don't think they would lose their purity even if they "let" them to rape them.

I agree with what the saints did and see it as a heroic act. I just don't understand why do they say "and this way they preserved their purity" like they would lose it if they let them. This tells me that you can only be pure if you stay a virgin. What is the catholic church understanding on this?
Virginity is the highest degree of chastity/purity, as St. Thomas Aquinas shows in Summa Theologica II-II q. 152 a. 3 "Whether virginity is a virtue?" ad 5:


  
  Conjugal chastity is deserving of praise merely because it abstains from unlawful pleasures: hence no excellence attaches to it above that of chastity in general [communem castitatem].
  Widowhood, however, adds something to chastity in general; but it does not attain to that which is perfect in this matter, namely to entire freedom from venereal pleasure;
  virginity alone achieves this.
  
  
  Wherefore virginity alone is accounted a virtue above chastity [in general],* even as magnificence is reckoned above liberality.


*[what he said above: communem castitatem / "chastity in general"]

So, here's the ranking of "freedom from venereal pleasure" (descending order):


virginity
chaste widowhood
chaste marriage / "chastity in general"


It's interesting to note that the Dominican friar Laurent d'Orléans, O.P., in his Somme le roi, whom French king Philip III commissioned in 1279 (not long after St. Thomas's death in 1274), devised a sevenfold ranking of chastity:

The chastity of


non-consecrated virgins
unmarried repentant non-virgins
marrieds
widows
consecrated virgins
ordained priests
the religious (monks, nuns)