"If you see the poor oppressed in a district, and justice and rights denied, do not be surprised at such things; for one official is eyed by a higher one, and over them both are others higher still. The increase from the land is taken by all; the king himself profits from the fields." NIV translation
Solomon not only sees the corruption of religion but also the government. We see, here, that the poor man does the work and the leaders and rich folks get all the increase. The religious system does not help the poor and the business and political systems use them as pawns and slaves. We have to remember that Solomon was a king and yet he still saw how wrong this is. When asked about the greatest commandment, Jesus said that we are to love God and love our neighbors. How can be love God and not have compassion on the poor and the oppressed?
Solomon was probably the richest man the world has ever seen and yet this is what he found out about the pursuit of wealth. After you have what you need to survive, the rest is usually just put on display as he says here. In the end, those things are not going with you (whether you go to heaven or hell).
"The sleep of a laborer is sweet, whether he eats little or much, but the abundance of a rich man permits him no sleep." NIV translation
Since the fall of man (Genesis 3), Adam and his descendants (all of us) have had to work for our food. Solomon found that the man that works for what he has sleeps better than the rich man. It seems that the rich man becomes a hostage to his wealth and constantly worries about someone stealing from him or how he can get more.
"I have seen a grievous evil under the sun: wealth hoarded to the harm of its owner, or wealth lost through some misfortune, so that when he has a son there is nothing left for him. Naked a man comes from his mother's womb, and as he comes, so he departs. He takes nothing from his labor that he can carry in his hand." NIV translation
Wealth is fleeting and Solomon came to realize that we do not create anything and are not taking anything with us when we die. How sad it is to see someone who seemingly has everything that this world has to offer but they do not have what is important and eternal. When they stand before the Judge, they will not have anything in their hands and, without the love of God in their hearts, they will be doomed.