To appreciate why this matters, compare the social space of the library with the social space of commercial establishments like Starbucks or McDonald’s. These are valuable parts of the social infrastructure, but not everyone can afford to frequent them, and not all paying customers are welcome to stay for long.

Older and poor people will often avoid Starbucks altogether, because the fare is too expensive and they feel that they don’t belong. The elderly library patrons I got to know in New York told me that they feel even less welcome in the trendy new coffee shops, bars and restaurants that are so common in the city’s gentrifying neighborhoods. Poor and homeless library patrons don’t even consider entering these places. They know from experience that simply standing outside a high-end eatery can prompt managers to call the police. But you rarely see a police officer in a library.

This is not to say that libraries are always peaceful and serene. During the time I spent doing research, I witnessed a handful of heated disputes, physical altercations and other uncomfortable situations, sometimes involving people who appeared to be mentally ill or under the influence of drugs. But such problems are inevitable in a public institution that’s dedicated to open access, especially when drug clinics, homeless shelters and food banks routinely turn away — and often refer to the library! — those who most need help. What’s remarkable is how rarely these disruptions happen, how civilly they are managed and how quickly a library regains its rhythm afterward.

The openness and diversity that flourish in neighborhood libraries were once a hallmark of urban culture. But that has changed. Though American cities are growing more ethnically, racially and culturally diverse, they too often remain divided and unequal, with some neighborhoods cutting themselves off from difference — sometimes intentionally, sometimes just by dint of rising costs — particularly when it comes to race and social class.

Libraries are the kinds of places where people with different backgrounds, passions and interests can take part in a living democratic culture. They are the kinds of places where the public, private and philanthropic sectors can work together to reach for something higher than the bottom line.

This summer, Forbes magazine published an article arguing that libraries no longer served a purpose and did not deserve public support. The author, an economist, suggested that Amazon replace libraries with its own retail outlets, and claimed that most Americans would prefer a free-market option. The public response — from librarians especially, but also public officials and ordinary citizens — was so overwhelmingly negative that Forbes deleted the article from its website.

We should take heed. Today, as cities and suburbs continue to reinvent themselves, and as cynics claim that government has nothing good to contribute to that process, it’s important that institutions like libraries get the recognition they deserve. It’s worth noting that “liber,” the Latin root of the word “library,” means both “book” and “free.” Libraries stand for and exemplify something that needs defending: the public institutions that — even in an age of atomization, polarization and inequality — serve as the bedrock of civil society.