How did Virgo get its name?
Virgo - "the Virgin" in Latin, whose Greek name was Parthenos (Maiden or unmarried female). Maiden carrying a sheaf of wheat.
Confusion and chaos run wild when it comes to the naming of and the mythology behind the constellation of Virgo (I bet that drives Virgos crazy!).
However, many ancient sources do appear to agree on associating the constellation of Virgo with the maiden aspect of what's called the "tripartite Mother Goddess" (maiden, mother, crone). After that, it's anybody's best guess as to who Virgo was.
According to Theony Condos (Star Myths), in antiquity Virgo was associated with Dike, Demeter, Tyche (Fortuna), Thespia, Kore (aka Persephone before she became the queen of the underworld), Eileithyaia (goddess of childbirth), Athena, and Hecate.
Granted, one of the most popular associations for ancient sources was that of the Greek goddess, Dike (meaning justice). The story goes that during the Golden Age of humanity, the gods lived among mortals. Slowly the morals of humanity deteriorated to the point that the gods began leaving one by one. Dike (daughter of Zeus and Themis) was the final goddess to give up on humanity and leave earth.
Postscript: According to Hyginus in De Astronomia (who - in this case - I wouldn't bet the farm on), Parthenos is the daughter of Apollo and Chrysothemis (an Eleusinian demi-goddess of the harvest), who after her premature death was placed by her father (Apollo) among the stars. I remain highly skeptical, as this uncorroborated version of how the constellation of Virgo was named appears to not be part of the original book and was added by a much later anonymous writer.