Vanity (sometimes referred to as pride in the Bible) occurs when we decide something makes us an overall better or more valuable individual than others. The definition of lust includes far more than strongly desiring illicit sex (Matthew 5:28, Romans 1:27). It is the intense desire and demand that we have something because we decide we need it.
Vanity ultimately seeks validation in the eyes of others. For example, the devil not only wants to rule everything, but is vain enough to think he is deserving of worship (which will happen in the end time). This worship will underscore, to him, his believed superiority (Isaiah 14:13 - 14, Revelation 13:7 - 8). Lust, however, simply demands from others what we do not have.
Vanity and lust are quite similar. They both are self-absorbing and self-centered deceptions that leave little, if any, room for considering the wellbeing of others. In fact, both lust and vanity can be pursued so intensely that their negative impact on the lives of others is either minimized or not even considered.
The attitudes of vanity and lust are also linked together as they are the first two sins ever committed. Lucifer turned himself into the first vain being when he decided his beauty, wisdom and all that he was blessed with made him greater than his Creator (Ezekiel 28:16 - 17). The devil's new selfish way of thinking then led him to foolishly pursue the power and authority of his Maker (Isaiah 14:13 - 14).
King Solomon lists a proud look (vanity) at the top of his list of seven things God hates (Proverbs 6:16 - 19). Pride is also considered, by the Catholic Church, one of the seven deadly sins or attitudes. Paul states that those who do not have God live according to the vanity of their own minds (they decide for themselves what is right and wrong, Ephesians 4:17).
Lust, according to Paul, is directly linked to breaking the tenth of the Ten Commandments which forbids coveting (Romans 7:7, Exodus 20:17). It is both deceitful and corrupting (Ephesians 4:22) and wars against what is truly good for us (1Peter 2:11).
The book of James teaches that human nature's tendency towards lust is the ground from which further sin can blossom (James 1:13 - 15). He also states that contentions and conflicts between people spring from trying to fulfill its selfish desires (e.g. lusting for material goods, James 4:1 - 3).
The Apostle John ties all of the above together when he states that the lust of the flesh and eyes, as well as the pride (vanity) of life, leads to eternal death (1John 2:15 - 17).
The twin sins of lust and vanity are based on a single great deception. This deception is that an individual can achieve their greatest existence possible through focusing on themselves and their own desires. This is diametrically opposite to what Jesus taught.
Christ revealed that those who seek to "find" their life will lose it, but those who lose it (through selflessly loving others) will find it (Matthew 10:39). We must therefore place God at the center of our personal universe and not pursue the destructive sins of lust and vanity.