The person who pays the fine isn't forced to give food to the poor. That person is out $2 either way; he or she simply chooses to have it go to the poor instead of to the library. But the taxpayer has to pay $2 more to support the library. Thus, in effect, there's a forced transfer of $2 from the taxpayer to the poor.
No, not really. The fines should go toward running the library. Diverting them to charity instead forces the taxpayer to contribute to charity without his or her consent. If the library wants to have a collection basket for food, fine.