When your home is also your workspace it's very easy to never stop working. Being a New Yorker with most of my co-workers in SF or the valley, your 5 pm quickly becomes 9 pm. It's also very easy to isolate yourself at home, particularly during the winter. Being able to tell your co-workers you need to head home puts up boundaries.
If you live with someone the interruptions you'll get during the day are far more personal than if a co-worker comes over to talk or ask questions. People that don't code often don't realize the amount of concentration you need to get good work done, to them it's just you working on a computer, so what's the big deal if they interrupt you with life questions or tasks? It compounds and can become an issue if you're not careful.
For me a co-working space like WeWork doesn't fit my needs, but I went in on an old loft space in Brooklyn with some friends and it's great. I have a place to walk to every morning, I have a workbench with tools for any hardware things I want to hack on when I don't have client work, I have all my math and cs books here, I can take lunch with people in the space if I feel like it, etc.
And if the weather is bad or I'm feeling sick, I can always opt to work from home for the day.
[p.s. we have a couple desks that just opened up if any HN people in NYC need space!]