A cycle of defiance often passes from one generation to the next, even when the consequences are fresh in memory. The generation that grew up in the desert, the children of those who left Egypt, tragically repeated the mistakes of their parents. They continued a pattern of rebellion against God, ignoring His voice and breaking the very laws and rules He had given to provide life to mankind [ביאור שטיינזלץ].
The primary approach among commentators is that this defiance is tied to specific historical events, most notably the worship of Baal Peor, which took place after the original generation had already passed away. Other perspectives broaden the scope of this rebellion. Some include the tribe of Dan's turn to idolatry [רש״י], while others point to the bitter uprising led by Korah and his followers [מצודת דוד].
Because this new generation strayed from the proper path, failed to keep the Commandments, and violated the Sabbaths, God's anger was triggered. In response, He declared His intention to pour out His wrath and completely spend His anger upon them while they were still in the desert [מלבי״ם, ביאור שטיינזלץ].