Libraries are typically run by the government. Governments aren't supposed to censor speech. Private platforms are a different matter by law.