The quotation to which you refer is from the play All's Well That Ends Well, Act III, Scene iii. The words are spoken by Mariana
Come, let's return again, and suffice ourselves with the report
of it. Well, Diana, take heed of this French earl: the honour of
a maid is her name; and no legacy is so rich as honesty.
This is a rather cynical pun, since it is uttered to the young woman Diana. Diana will take part, later, in a lie which deceives Bertram into sleeping with another woman (which is actually his own wife) rather than herself. The pun on "honesty" is sexual as well as equivocal. The word was applied, in Shakespeare's time, to mean a young woman's virginity. So, even though Diana will later agree to an elaborate lie and a deception, she does it in order to gain a large amount of money for her dowry from Helena. The word "legacy", in this case meaning an amount of money used for a legal contract (a marriage instead of a will) is another pun, signaling that Diana is willing to barter her own word (and, in word at least, if not her actual virginity) for money in order to get a good marriage and hence no longer be a "maid". This passage, while it can be taken as a proverb, is actually meant, in this play, as nothing of the kind. It is a veiled jest which the audience understands, and the speaker and hearers don't necessarily comprehend. "Honour" is also played upon -- this was another synonym for female virginity, and also is a foreshadowing of the dishonorable conduct of Parolles later in the play. The whole phrase, taken in its literal meaning (and as Mariana means it) is thus: The honor (or worth, and honor is mentioned because they are just discussing soldiers, whose primary concern should be their honor) of a young unmarried woman is in her status as a virgin; and nothing is so important as the keeping of that virginity until marriage. This is particularly funny now because, at least in name, Diana will later agree to a sexual tryst with the "French count" (Bertram) of whom her mother and her mother's friend are just now speaking. This is a passage rich with double meanings, and this is perhaps only a fraction of them.