In this quotation, I think Hesse is saying that to really love and appreciate the world, in all its perfection, one needs first to experience the most "shameful" aspects of life, such as "the desire for possessions" and "vanity." The implication is that only by experiencing the bad can one really appreciate how good the good is. One might argue that, in much the same way, one can only really appreciate happiness if one has first experienced sadness, and that the greater the degree of the sadness, the greater appreciation one will be able to have for the happiness.
This idea is reminiscent of the concept of yin and yang in Chinese philosophy, in which all opposite forces are interconnected and interdependent. In other words, happiness and sadness, or hope and despair, or ignorance and enlightenment, are all interconnected and interdependent. One cannot really be happy without sadness, hopeful without despair, or enlightened without ignorance.
I think this sentiment pertains to all people because I suspect all people have experienced degrees of happiness and degrees of sadness. Perhaps the sentiment only pertains in its fullest sense, however, to those who have experienced severe degrees of sadness. Perhaps is is only those who have, as it were, hit "rock bottom" who are capable of appreciating (to continue the metaphor) the awesome beauty at the mountain's peak.