Here is another condition for spending: {spend from the good things which you have earned} Never steal and give away. In this context, a poet once said:
‘Condemned is she,
Who wants to do the good
From what to her genitals they pay,
Neither she enjoys nor gives away,’
Spending should be as legislated by the Almighty in order to get accepted by Him.
Reason of revelation:
Sahl Bin Haneef narrated that people used to pick the worst of their fruits to be given away as a charity. Therefore, (And do not aim toward the defective therefrom, spending [from that] while you would not take it [yourself]) was revealed.
The verse should be generalized in terms of meaning rather than considered to be for a specific reason. So, spend what you love when you want to do that.
{لَن تَنَالُوا الْبِرَّ حَتَّىٰ تُنفِقُوا مِمَّا تُحِبُّونَ}
(Never will you attain the good [reward] until you spend [in the way of Allah] from that which you love.) (Aal-Imran: 92)
So, it should be from what you love not the bad or the rotten.