Companionship or fellowship would be the primary opposites. Popular people don't necessarily have these, and they can still be lonely.
I was very popular in high school, and I have far, far fewer friends today, but I'm less lonely because of the level of my friendships - to use my self as an example.