For decades, public libraries across the country — and their staffs — have operated under a modern understanding of court rulings that say books and other materials cannot be removed simply because government officials do not like the ideas they contain.