Governing authorities needed to know the exact number and distribution of a population for the purposes of taxation and conscription, but the enquiry was resented by those in Israel who were opposed to the despotic claims of the monarchy. David is said to have been punished for ordering a census—though the punishment was inflicted on the very people being counted (2 Sam. 24: 15).
The census at the time (4 BCE) of Jesus' birth (Luke 2: 1–5) involves a historical problem in that Quirinius, said to be governor at the time, did not become governor of the province of Syria until the year 6 CE—when indeed a census was held. A universal census, with such social chaos and movement as described in Luke 2: 1, is in any case most unlikely. One way of reconciling the data is to suppose that Quirinius had a minor post in Syria in 4 BCE and that Luke calls him governor because that is how he was generally remembered. Another suggestion is that Luke's account of the journey of Joseph and Mary from their home in Nazareth in Galilee to Bethlehem in Judaea is an editorial device in order to fit Jesus' birth into plausible OT prophecies. For example, Micah (5: 2) appears to associate a Messiah with the house of David who came from Bethlehem (1 Sam. 16: 1).