The Book of Ecclesiastes is taking a look into the natural (unsaved) man's life through the eyes of Solomon. The natural man is trying to find meaning in life and searching for fulfillment and purpose. The Bible says the natural man is without the Spirit and unable to understand spiritual things.
Solomon's main point in verse 2, "Vanities of vanity, all is vanity" means that without the spiritual side of life, everything is meaningless. For a Christian, however, this is not the case. Our identity is in Christ, and that is what gives us value and a purpose.