Therefore, I say this and testify in the Lord: You should no longer walk as the Gentiles walk, in the futility of their thoughts. (Eph. 4:17)(HCSB)
The word translated vanity is religious error, mirage, or illusion. The unbeliever may be very religious as were the people of Ephesus who were not Christians, but he is under an illusion. He is thinking that what he has is real when there is no reality in it. The unbeliever is under the illusion that he can save himself, that by his religious acts and good character he can make himself acceptable to God. He thinks of the cross as being foolishness (1 Cor. 1:18, 23). He is also under the illusion that sin is not a serious thing; in fact he has given himself over to lasciviousness, to work all uncleanness with greediness.
But the Christian life has nothing to do with the former manner of living. The Christian is to put off the old man which is corrupt according to deceitful lusts, and he is to put on the new man which after God is created in righteousness and holiness of truth (Eph. 4: 22, 24). The Christian life is a different life. It is characterized by holiness and righteousness. Paul urges his readers to let all bitterness and wrath and anger and clamor and evil speaking be put away from them. This is the blessed work of the Holy Spirit. When He is permitted to do this He is not grieved, but when these awful characteristics are allowed to remain in the life He is grieved. Let us obey the Scripture.
(Dr. R. H. Belton)