He realized that happiness was not produce by just gathering material possessions. We can see another example if we observe the structure and function of our body. No organ of our body is existing for itself. Every organ in our body is existing in relationship to other organs. We could say that there is a fundamental principle in the universe which causes everything in creation to live in relationship to something else.
Nothing exists for it's own benefit.
Therefore, We could conclude that goodness is accomplished when we live for the sake of others. This is why the way of true religion has been the way of self-denial. God's purpose in creating was to carry out that ideal of living for the sake of others. That is the basic will of God. Thats why if we live for the sake of God's will, we will be living for the sake of others and we will feel true joy and lasting value.