Why do governments count their people? Taxes. Why did God count Israel by ordering a census? As a preparation for the war to come.
Despite the Baal Peor's incident, God did not consign the second generation for another forty years in the wilderness. He could have done that for the sin of the children in worshiping Baal is identical to the sin of their parent with the golden calf.
Instead, God orders a census, and the census is never a good sign for counting is usually reserved for animals not the children of a king. So when the Lord orders a census it is seldom a blessing.
The Israelites must have been distraught by the census and their spirit must have hit a new low when they heard of the succession of Moses by Joshua. Indeed, Moses would not cross with them into the Promised Land; Joshua would lead them there.
The striking difference between this generation and the previous one is in their readiness to cross and face whatever may come. In this, they show themselves more obedient, less rebellious than their parents, and stave off God's wrath.
Chapter 25 ends with the calendar of public sacrifice. God is constantly reminding Israel -- and reminding us -- that the best thing we could possibly do is to worship Him, the one true God who does not need our worship. Indeed, we need to worship God so that we may be constantly reminded of who we are.