Bhagavad Gita · 17.22
अदेशकाले यद्दानमपात्रेभ्यश्च दीयते।असत्कृतमवज्ञातं तत्तामसमुदाहृतम्॥
adeśha-kāle yad dānam apātrebhyaśh cha dīyate asat-kṛitam avajñātaṁ tat tāmasam udāhṛitam
Charity given at the wrong place and time, to unworthy recipients, without respect and with contempt — that is declared to be in the mode of ignorance.
— Bhagavad Gita 17.22
Source: Sacred-Texts.com (Sanskrit) + Bhagavad-Gita.io (translations)