Joseph Smith taught, "That friendship which intelligent beings would accept as sincere must arise from love, and that love grows out of virtue, which is as much a part of religion as light is a part of Jehovah."
In the common vernacular, virtue is often used to refer to sexual purity or chastity. Virtue is, however, much broader than the morality niche of personal worthiness. It is an all-encompassing purity or worthiness before God that gives power to our faith. Synonyms of virtue may include chastity, purity or power.
The significance of virtue is that, although it may seem to have multiple definitions, these definitions need not be mutually exclusive. When the Lord tells us to let virtue garnish our thoughts, for example, chaste thoughts as a rule only tell half of the story. The other half is to fill our minds with power, or in other words, to always remember him.
Thus, Proverbs can speak of a virtuous woman being more precious than rubies while Doctrine and Covenants refers to powers and influences being held by virtue of the priesthood. Because worthiness is power, either definition of virtue can be used in either case.
We often list virtues or 'powers' that guide a disciplined life. Peter listed virtue as a necessary step between faith and knowledge (see 2 Peter 1:3). It is more than just coincidence that Peter's list of virtues are listed in the same order several other places in scripture (D&C 4, D&C 130, etc.). We cannot receive knowledge, or a confirmation of our beliefs, without first acting on our faith. As we do so, we add power to our faith-- that is, we add virtue to our faith, and can qualify for a knowledge of things that are true.
Lust is the opposite of virtue. Lust turns us to our carnal desires-- be they for sexual things or for power or for another piece of pie-- and allows the physical to overcome the spiritual. When we give in to lust, we lose capacity for love and also friendship. Though we may seek the unity of marriage, for example, we lose the ability to love even our spouse when we allow lust to control our lives.
On the other hand, as Joseph Smith taught, as we grow in the worthiness and power of virtue, our capacity to love grows. Hence the saying of Jesus, who had perfect virtue, "Greater love hath no man than this, that a man lay down his life for his friends." That kind of friendship "must arise from love, and that love grows out of virtue."