The backdrop for this sermon is Deut. 4:5-8. We are to live as God intended so the nations will notice and turn to God. Ecclesiastes calls out many of the things people live for: money, pleasure/comfort, success/achievement, etc. The Teacher's wisdom reveals we have far less control over these things than we care to admit (in fact, he'd say we don't have any control over them!) and therefore it is foolish to base your life on them. After all, hevel happens.