The Lord had announced the covenant curses for disobedience, and included therein the curse of no rain and no produce (Deuteronomy 11:17). As all things are under the control of God and do what he says (Psalm 135:6), so he carried out his covenant curse upon these returned exiles.
10 Therefore the heavens above you have withheld the dew, and the earth has withheld its produce.