Generosity in Buddhism - When does giving become unwholesome?
Unwholesome actions are those which are based on the three poisons: greed, anger and delusion. When giving is wholesome it is an act of renunciation and it reduces the three poisons.

Giving becomes unwholesome if it is based on the three poisons. Perhaps you want to be famous for giving money so you are willing to give all your cash to charity; in this case you would effectively be buying fame and it is fueled by greed. This kind of giving is like a trade, you still want money but you've decided that fame is worth more; this type of giving is not renunciation.

You can come up with similar examples where the act of giving increases anger or the delusion of self-view, they would all be unwholesome giving.