A chained library is a library where the books are attached to their bookcase by a chain, which is sufficiently long to allow the books to be taken from their shelves and read, but not removed from the library itself. This would prevent theft of the library's materials. However, it also led to crowding and awkwardness when readers had to stand side by side, each holding a book or clumping so they could share one. The practice was usual for reference libraries (that is, the vast majority of libraries) from the Middle Ages to approximately the 18th century. However, since the chaining process was also expensive, it was not used on all books. Only the more valuable books in a collection were chained. This included reference books and large books.

Based on this passage, game of thrones why are there chains in the library? Let's give stream of consciousness first:
To answer this question, we should know that: A chained library is a library where the books are attached to their bookcase by a chain, which is sufficiently long to allow the books to be taken from their shelves and read, but not removed from the library itself.
So, the final answer is to allow the books to be taken from their shelves and read , but not removed from the library itself.