Do you see it as... 1. Criminal 2. Immoral 3. Having downsides
I think we agree it's not criminal (as scale doesn't apply to a binary criminality judgement stealing a penny is as criminal as stealing a pound though punishment will vary).
Are you suggesting it's immoral? Because I can't see where you make such an argument.
Or are you saying well it has downsides as authors may earn less? It's likely book purchases are affected by libraries. I don't think the effect is as profound as people think.
Without that context it's quite hard to discuss this topic.
That's how you get books written by authors who are good at filling out government forms, not books written by good authors. See the many terrible pieces of public art that is required in many places as part of public construction projects as an example of what I'm talking about.
Other libraries I've been in have used book sales with donated books to raise funds for the library.