Well God did also say to be prudent and store up- He Even put Joseph in charge of storing up grains for the coming famines- Storing up for bad times and hoarding are two different things- hoarding involves getting more than you will lever need- and deprives others of things they will need- and these hoarders never share what they have whn others are in need-
Slightly different way to look at it: God provided for their needs using Joseph.
If we don’t listen and obey, we miss many blessings and opportunities. Reminds me of what is attributed as a Swedish proverb:
God gives every bird a worm, but he does not throw it into the nest.