In 1927 the Holy See forbade public vows of virginity apart from entering a religious institute (AAS 19 p. 138); no reason was given why:
To the dubium:
An expediat concedere facultatem dandi benedictionem et consecrationem Virginum mulieribus in saeculo viventibus
Whether it is expedient [for the pope] to give [bishops] the faculty to bless and consecrate virgins living in the world
the Holy See responded:
Negative et nihil innovetur.
Negative and no changes.
Presumably it was considered inexpedient because of the dangers of upholding a vow of virginity in the world. Also, "nonnulli locorum Antistites petiissent facultatem [several local bishops requested the faculty]."
The 1983 Code reinstated the "order of virgins" (Can. 604).
Public vows of virginity were permitted in other eras of Church history, too.
Consecrated virginity is a vocation, so perhaps the Church wanted to give more official support to it, considering the drastic decline in female religious life after Vatican II.*
The ceremony for consecrating a virgin is in the Pontificale Romanum:
cf. The Mystery of Love for the Single by Fr. Unger, O.F.M. Cap. (1958) ch. 5 and this informative blog by a consecrated virgin.
*appendix of Liturgical Time Bombs in Vatican II by Michael Davies:
"• Sisters. 180,000 sisters were the backbone of the Catholic education and health systems in 1965. In 2002, there were 75,000 sisters, with an average age of 68. By 2020, the number of sisters will drop to 40,000—and of these, only 21,000 will be aged 70 or under. In 1965, 104,000 sisters were teaching, while in 2002 there were only 8,200 teachers."