The university I went to did start restricting hours (requiring student IDs for more of them than it used to) during my time there, apparently to try to divert some homeless people away at night.
But I've never actually been to a library that didn't feel safe, clean, and comfortable when I was there, including that one. I certainly never saw any signs of drug use, or anyone browsing pornography.
I also want to add that being homeless isn't the same thing as being disorderly, frightening, unfriendly, or smelly.
Over the years, I've had friends who were homeless (depending on the person, before or during the times that I've known them). Sometimes they have a lot of difficulty getting bank accounts, jobs, or apartments in part because of documentation issues or bureaucratic tasks that they need internet access to solve. Libraries are a lifeline that helps homeless people rebuild stable lives.
Libraries should be sanctuaries and feel safe for everyone, including the most precarious people in society.
But I've never actually been to a library that didn't feel safe, clean, and comfortable when I was there, including that one. I certainly never saw any signs of drug use, or anyone browsing pornography.