I read an article about a college student who actually did that, due to lack of money. Unfortunately, the big problems are food preparation and eating (you don’t want to make a mess in there or get crumbs on the books) and getting access to a shower.
However, I would think it would be awesome to have a library with small living spaces built into it. This would allow for a balance between privacy and access to reading material. If I were to build a university tomorrow, I’d definitely want to offer that.