The Israelites are whining again some more and decide to return to Egypt. Moses and Aaron prostrate themselves before them, and Joshua and Caleb try to argue for taking the land that was promised them, saying the Canaanites will be defenseless in the face of god. The people decide to stone Joshua and Caleb. Heh.
God, despite having promised Noah that he wouldn't kill everybody anymore, offers to kill them and let Moses start over with a new people. Moses convinces him not to with the old argument that the Egyptians and Canaanites will say he wasn't able to lead his people so he killed them instead. He flatters god, saying The LORD is long-suffering, and of great mercy, forgiving iniquity and transgression, and by no means clearing the guilty, visiting the iniquity of the fathers upon the children unto the third and fourth generation (v. 18). Nobody, not god, not Moses, not Jerry Falwell, takes note of the irony of that verse, a 'merciful' god that punishes you for stuff your great-grandfather did.
God is convinced not to kill everybody, just the people over 20. He also decides to save Caleb's and Joshua's clans. His method will be to send them into the wilderness for 40 years, because the spies stayed 40 days. Yup, that's showing them mercy, all right.
As for the spies themselves? Well, they die of plague. The people hear about this and decide to go get Canaan right now. They attack over Moses' protests that god isn't with them, and get their stupid asses killed.