“Simlascha Lo Balsa MeiAlecha; Your clothing did not wear out in forty years.” (Eikev 8:4) If Bnei Yisrael had everything they needed in the Midbar including food, shelter, and clothing how were they able to do the Mitzva of Tzedaka in the Midbar?
Rav Shimshon Pincus answers that in truth they could not do this mitzva. Why? “Tzedaka Tatzil MiMaves; If there is a decree on someone that he must die, giving tzedaka can abolish the gezeira.” Hashem was Gozer in the Midbar that the entire generation would die. Had there been the possibility of tzedaka it could have altered the plans, which was not the way Hashem wanted it. Therefore, Hashem made it impossible to give tzedaka, and the decree was carried through unimpeded.
From Revach.net