When you write, you're doing it alone. It follows that if you can't embrace loneliness...you can't really be a writer.
There are times when the world is only me and the screen right in front of me, a scrolling marquee of black text that just keeps getting longer and longer with each new thought that enters my head. Writing is a very self-involved experience. The real world goes away as you sink deeper and deeper into the one you're creating.
And that gets lonely. As a writer, you can get lonely even if you're writing in a room surrounded by people. It's just you and the screen. Sometimes, that's great. You're in the zone and you're typing and it's all flowing well. Other times, it's terrifying. The white screen is staring at you, mocking you, taunting you.
You are alone with the screen. You're on your own with the plot, the characters, every twist and turn. Perhaps you have someone to bounce your ideas off of, but only you really understand the world you're writing. Only you do the typing, the editing, the agonizing and the imagining.
That's lonely. There are going to be times when you drive yourself a little crazy. Doing great writing means being isolated, totally within your own head and totally living on the page. The rest of the world fades away. So remember to step outside of that space every once in a while. Make an effort to connect with real humans (not just Twitter followers) and get away from work to have fun.