If pornography were a drug, one of its side effects would be self-pleasuring. If you think such things do not go on in libraries, check out (at your own risk) You Tube for personally captured videos.
Since sex is on the Berkeley Public Library’s list as one of “the 5 big no-nos in the library” — that should tell us something. At a branch library one day, I left because a man was thus occupied and there was no staff available to deal with the problematic behavior.
A librarian I know had to tell a patron who was engaged in such activity that it was not allowed at the library. His angry response was “I was not! Who said that? Where are they?” This responsibility — that the librarian has to interact with such people in order to maintain propriety - is actually a job for the police. The perpetrator of such activity knows that most likely the police will not be called and that there will be no arrests or incident reports. It is a case of “the less the public knows, the better.”
Since all of us have different standards of behavior, this will continue. Pornography sexually excites, therefore, this will continue. As long as no arrests happen, this will continue. As long as we keep silent about it, this will continue.