2 Samuel 24:2

For the king said to Joab the captain of the host, which was with him, Go now through all the tribes of Israel, from Dan even to Beer-sheba, and number ye the people, that I may know the number of the people.

The order to number Israel from Dan to Beer-sheba was given when Israel had prospered and increased in numbers, strength, wealth and greatness, yet had become exalted and proud, forgetting God the Giver of mercies and losing its peculiar holy character separate from surrounding nations, while David in prosperity had lost the humility and trust in God of his earlier life. The order was an act of pride and ambition in which David took glory to himself by comparing Israel's former fewness and weakness when he took the throne with its present wealth, strength and greatness under his rule. In giving the order David yielded to the temptation of the devil, and the act was a great, foolish sin and transgression that displeased God and broke His express command.

The effort to number Israel was an expression of selfishness, treating God's gifts and benefits as though they could be claimed for selves alone, in contrast with the truth that eternal life is freely offered to all who receive Christ without distinction of nationality, tribe or clan. The act would lead Israel to rely on strength of numbers instead of the living God. The numbering was not done according to God's order.

The work of numbering was not fully completed before David was convicted of his great sin, saw his error, humbled himself and confessed, but his repentance came too late to turn aside punishment. A choice of punishments was set before David, and he showed confidence in God by choosing to fall into the hands of a merciful God rather than the cruel mercies of wicked men. Swift destruction followed by pestilence, with seventy thousand destroyed, while David and the elders mourned in deepest humiliation. As the angel with drawn sword was stretched out over Jerusalem to destroy it, God out of pity for His rebellious people bade him stay his work of death.

David, terribly afraid yet compassionate for Israel, cried out, confessed that he had sinned and done wickedly, and begged that God's hand be against him and his father's house and not upon the people, the sheep. God commanded through His prophet that David make atonement, and David's hearty repentance was accepted. Araunah's threshing floor with cattle and all needful for sacrifice was offered freely, but David refused an offering that cost him nothing and bought it for full price, because the Lord would accept the sacrifice he was willing to make. There David offered burnt offerings and peace offerings, God answered by sending fire from heaven to consume the sacrifice, and commanded the angel to put his sword into its sheath and cease the work of destruction.

The verse warns against taking up work God has not assigned, including efforts that distract from carrying the message of warning to people who have not yet heard it. The verse warns against advancing human plans that separate God's workers from the world and hinder the work God would have done. The verse warns against taking it upon oneself to number or measure God's people, for no person has authority to assess the worth or standing of fellow workers by human standards, because people cannot read the heart and God alone judges the secrets of each person.