It is better to go to the house of a mourner than to the house of feasting (Ecclesiastes 7:2).
Progress and achievement in life come from identifying the challenges of reality and dealing with them effectively. Anything that constitutes an escape from reality is destructive, because an escape from reality is actually an escape from life itself.
The house of feasting which Solomon criticizes is literally "a house of drinking." In his era, like modern times, the participants at some social gatherings put themselves into an alcoholic stupor, talked senselessly, and made believe that the world was free of stresses and problems. Such "feasting" constituted an escape from reality and contributed nothing to the betterment of the participants.
The house of the mourner is a solemn place, which confronts people with the reality of their own mortality. There we recognize, at least momentarily, that our stay on earth has a limit, and that so many of the things that we spend our lives to attain are left behind when we die. Our only permanent acquisitions are our spiritual achievements, such as our good deeds and our positive effects on others. The house of the mourner actually brings us to an enhanced appreciation of reality.
Is it more pleasant to go to the house of the mourner? Of course not. It is "better," however, because it can contribute to our betterment.