17 Moreover the Fathers of the Church considered this obligation of perfect chastity as a kind of spiritual marriage, in which the soul is wedded to Christ; so that some go so far as to compare breaking the vow with adultery. Thus, St. Athanasius writes that the Catholic Church has been accustomed to call those who have the virtue of virginity the spouses of Christ. And St. Ambrose, writing succinctly of the consecrated virgin, says, "She is a virgin who is married to God." In fact, as is clear from the writings of the same Doctor of Milan, as early as the fourth century the rite of consecration of a virgin was very like the rite the Church uses in our own day in the marriage blessing.
Source: Sacra Virginitas (Vatican.va)