Depression
Depression can cause loneliness in two ways. One, someone with depression often does not have the desire or ability to make the effort of meeting people or going out. Two, they can be so negative and down that people stop trying to be their friend.
Low Self-Esteem
Sometimes people have had a series of experiences that have left them discouraged and beaten down. Their self-esteem has been shaken to the core. They are just not willing to put themselves out there to be shamed again.