At my undergrad university, the library didn't stay open all night, but I think it should have - most of the books there, we were unable to borrow, so if you were trying to finish an essay in a hurry, not having access to the books was a real pain. I never did an all-nighter as an undergrad, but many of my classmates did and would have liked a 24 hour library, as we attended a campus uni & many would have simply stayed all night working and then handed in work early the next day rather than having to go home when the library closed, working, and then having to come back again.
My current university does have a 24 hour library, and while I wouldn't say it's changed my study habits (I've rarely been in there past 11pm say), I know of many people who use it overnight, and it's comforting to know it's there if I am having a last-minute crisis about something. We do all live closer to it as well, compared with my undergrad one.