The worst loneliness is to not be comfortable with yourself.
Although placing sentimental value on something or someone can be emotionally useful, attachment can become risky. If the object of interest changes, the result can be devastating in many ways. In other words, one should have good self-esteem to be happy. Without a definite "you", actions feel meaningless.
This is not the same as complete detachment from the world around you. Not defining yourself in terms of other things is not the same as ignoring the outside world.
Some people judge themselves on how much money they make, or how many home runs they hit. If you're a human of superhuman ability, this is usually not a problem. But the fact is, most of us are not superhuman. It is impossible for everyone to be above average.