I think it does to some extent. While it's not fun, it's necessary to really appreciate the value of meaningful relationships. Also, when you are lonely you end up doing things to stop feeling alone, which can be positive (although, of course, it can also be negative). I know in middle school, when I was feeling really alone, I wrote, and made up stories, which got me interested in writing, which is an interest I still have today. However, loneliness is never fun and is mostly negative, especially in large doses.