He goes to the library to watch porn.
People go to the library to read and check-out books and watch porn in private.
Computers at public libraries usually have adult content filters.
Porn is on computers, which libraries almost always have in addition to books.