In defense of the office
It is trendy these days to extol the virtues of remote working, and either implicitly or explicitly shame any company/manager that doesn't like it. While there are absolutely advantages to remote work or working from home, the one-sidedness of the conversation is, I believe, actively harmful. The idea of "going to work" is still a valid and useful one, and one that should not be cavalierly cast aside in Twitter snark the way it currently is.
I have been all over the spectrum in my career. I started my career in college as a part time freelance web developer, working from home/dorm, mostly for local politicians. Later, I worked as a Palm OS developer for a local company that had a brick-and-mortar office where I shared an office with one other developer. I moved from there to full time as an IT journalist for a company in Norway, so again working from home.
I then spent 10-ish years at Palantir.net, a web consulting firm in Chicago. When I started, Palantir was a 5 person company with a small open-plan office. Over time we hired a few remote people, then moved to a series of half-height-cube offices, then started getting more and more liberal with "work at home when you feel like it" policies to the point that even the Chicago-based employees were out of the office most of the time on entirely irregular schedules, with about 40% of the company remote. Toward the end of my time there I finally moved into one of the empty private-offices we had and started closing my door most of the day. (I wasn't assigned to one, technically; I just moved my stuff in and didn't leave and no one bothered to throw me out.)
I now work for Platform.sh, a Paris-based company that has maybe 15 people in the Paris office but ~100 more world-wide, including most of the C-suite. I work from a home office down the hall from my bedroom. I also spent almost a decade as one of the lead developers of Drupal, one of the world's largest Open Source projects and a radically distributed community.
All of that is to show that I have ample experience with both in-office jobs and remote jobs, as a remotee, colleague of remotees, and all-in-office jobs.
Criticize the right thing
Much of the hate directed toward office-based companies is, deliberate or not, a strawman. Specifically, it's popular to share articles about how terrible open-plan offices are and use that as justification for hating all physical-space offices.
Let's be clear: The science is in, and the verdict is clear: Open-plan offices are just plain stupid for office-type work. They hinder collaboration rather than encourage it, act as a source of distraction, and basically have no benefit for the majority of people other than saving management rent money and looking extra-hipster in posed fun-work-space photos.
I am not here to defend open-plan offices; my own experience with them is that once you have more than 2-3 people, they're awful. However, that does not mean all offices are bad! It just means bad offices are bad. (All tautologies are tautologies.) If you take nothing else away from this post, please stop using the terribleness of open-plan offices to justify hating on all non-remote companies. It's intellectually lazy and dishonest.
There are ample advantages to an office that has people physically co-located but still gives them some privacy, either through cubicles with good ambient sound baffling or private offices.
Challenges of remote work
There are many advantages to working remotely, or allowing your employees to work remotely, all of which have been expressed elsewhere far better than I can so I won't go too into depth on them. Mostly, though, they break down into flexibility, time savings, cost savings, privacy, and reduced environmental impact.
Those are all valid advantages of a good (emphasis on good) remote-work environment. They are not a panacea, however, and there are drawbacks. (And, conversely, all of these have a mirrored advantage being in an office.)
Remote communication is low-bandwidth. Most of us should be familiar by now with the way that body language, intonation, and other non-verbal forms of communication are just as important if not more important than specific words being said. Yet remote work tends to mean mostly text-based communication, which is far slower and lower-bandwidth than talking face to face. That strips away most of human communication. While video chats and screensharing are better than text-based interaction (when they don't fritz out, which is still disturbingly common), they are still not as immediate and high-bandwidth as being in the same room as someone; that's why remote companies still have periodic team on-sites, we still go to conferences, etc.
In large part because remote is low-bandwidth, training and mentoring is far, far easier to do in person. Training up a junior is much easier when you are in physical proximity and can "look over their shoulder" literally not just figuratively. The back and forth discussion, the ability to just point at something, the ability to explain something with off-the-cuff hand gestures, to draw random pictures on a piece of paper... these are critically important but either lost or severely weakened when you're not physically next to a person. It's also far easier to just... forget to check in on someone who is not physically nearby, because humans aren't biologically used to the idea of someone being close but far away.
For the same reason, when a company is is need of a culture shift it is easier to do in person. Culture change is a hard, messy, organic process that requires lots of repeated interpersonal interaction, even with all the best intentions. That is flat out easier to do in person than via Slack. Positive peer pressure works more effectively in person than remote. All else equal, team cohesion for an in-person team can be far higher than for a remote team.
Despite all that, remote work can still be highly distracting. Hearing background chatter from everyone else in a physical office is a real problem when trying to focus, but the same is true of background chatter in Slack/Discord/IRC/Hipchat/whatever your company's text-chat tool is. DHH has an excellent post on the downsides of chat as a key communication tool, so I won't repeat them here, but please go read his post.
The environmental benefits are debatable. Yes, working from home saves on car fuel. However, it can also increase home-energy costs! Most people don't leave their homes at full heat/cooling when no one is home (or they shouldn't, anyway), but if you work from home you're heating or cooling your home because you're always there. Unless you have a very small house, that means you have more space to heat/cool than the amount of square footage you take up in an office. Put more simply, the cost-per-person to climate control a shared office is lower than to climate control the same people in many home offices. Does that offset the benefits of not driving? That will vary widely depending on where you live, how far you would be driving, what car you drive, etc. Work-from-home may still be a net win, but not always. A former Drupal colleague once did the math for himself (I can't find the link now, unfortunately), and found that he used more energy working from home than he would in an office. YMMV (literally).
If you have no physical separation between work and home, it's much harder to have a mental separation. It's easy to work later than you intend, or to get distracted throughout the day by personal stuff. If you use the same computer and workspace for work and personal then it's even worse. If you have a small child at home, it's nice to be able to take breaks to care of them but it also means a constant source of distraction while working. That's not to say that people can't have a mental separation, but it's much harder when there's no physical separation to help you.
Humans need socialization. Even we introverts who like it in small doses still need human contact. Chatting with colleagues on Slack or periodic doesn't count, or counts only a tiny bit. Working from home if you live alone means you can go days without interacting with another person, or with only minimal interaction. As I write this on a Sunday, I haven't left my house since Wednesday night. That's abnormal (I do have social events and friends I go out with), but not strange. Working from home means, again, you have no built-in structure to encourage you to connect with other human beings, even if it's just chatting over lunch away from your desk. That's not good for your mental health, even for hard-core introverts like me.
We as humans need to do a better job of taking care of those around us. If you notice someone having trouble, we need to be able and willing to take time out from whatever we're doing and help our colleagues. That could be helping them with a thorny work problem, noticing that someone is unhappy in their work, or it could be noticing that someone may be having mental health challenges that need to be nipped in the bud. Those are easily 10x harder to notice remotely. If you don't know about a problem you cannot do anything about it. (Obligatory shout-out here to Open Sourcing Mental Illness and Mental Health First Aid.)
Time zones suck. International time zones suck even more. I have colleagues in about 20 time zones around the world. Ever try to schedule an all-team meeting with 20 timezones? Someone ends up getting screwed every time. Usually it's the Australians. Sorry Australia.
Some people just prefer working in an office with their colleagues, just as others just prefer working alone. Both are valid preferences; that's true for managers as well as employees.
Some of those issues can be ameliorated by co-working spaces, but that also eliminates many of the drawbacks of remote work: You still have to travel to it (time and environmental cost), it adds potentially more cost than having a single company office if you have a lot of remote employees, etc. It also doesn't help the in-team or in-company communication bandwidth issues; and god-forbid the coworking space be open-plan or low-cube; then you have all of the bad parts of an office and all of the bad parts of a remote setup.
A number of companies have a hybrid setup, with much or most of the company in a physical office but some of them remote. This creates its own set of challenges, most of which boil down to the remote part of the company being second-class citizens. Fighting against that is a challenge, and mostly boils down to skipping the advantages of having an office.
In essence, once you have even one remote employee, you no longer have an office; You have a remote company that owns its own coworking space. If you take advantage of many/most of the benefits of physical proximity, you are inherently disadvantaging your remote team. So instead, you hamstring your in-office employees in order to be fair to the remote folks. Either way, someone loses.
That was exactly the situation at Palantir.net by the time I left. The office culture was essentially hollowed out.
"Just do better"
Another common refrain I see bandied about is "if your company can't manage remote employees, get better managers."
By the same token, though, "if your employees can't manage working in an office, get better employees."
Both are rude, flippant, disrespectful snark to people that are, by and large, trying to do their jobs. As discussed above, managing a remote team is harder than an in-person team for very good, solid, human psychology reasons. That doesn't mean it can't be done, but it is harder and it's disingenuous to just dismiss everyone who is not (yet) highly skilled at it as people you should fire.
There are only trade-offs
A remote company is not intrinsically superior to an in-office company. It's a different set of trade-offs. Sometimes those trade-offs are worth it, but not always. Different companies, different cultures, different types of work, different histories, different geography, and different points in time all affect whether it's a good trade-off or not.
While it is true that "we only hire the best people (that are within 15 miles of an arbitrary location)" is hypocritical, it's also equally hypocritical to say you hire from anywhere to build the best team, and then hamstring that team's ability to work as a team by forcing them to do without most forms of human interaction. And research has also shown that a good team is far more than the sum of its parts, if it's allowed to work as a team.
Those who throw shade on offices should remember that.
Work where you will
None of that is to say that I am against remote work, or working from home. I work from home now, and I'm quite OK with it. But I am also OK with working in an office, depending on the company and circumstances.
If you'd rather work remotely from home, good for you. Seek out a company that offers that. There are many of them. But please don't act like the way you prefer to work is intrinsically superior. It's not. It has advantages, certainly, but it also has downsides, and to pretend those don't exist is irresponsible.