I was thinking about this the other day. How long ago did keeping a census of population begin? It is a fairly modern thing?
Censuses have been around for a considerable time, actually! It's even mentioned in the Bible that Augustus Caesar ordered a census of the Roman realm around the Birth of Christ (Gospel of Luke, 2: 1-7). My Roman history is fairly sketchy, but this was probably undertaken in order to survey taxation and conscription.
Fast forward to the Tenth Century, and you have the Miniguhud Senchusa fer nAlban, or "The History of the Men of Scotland." Although it is primarily a genealogical work, the "Senchus" outlines the lineages of kings and the numbers of men in the various kin-groups ("cenels") across the Kingdom of Dal Riata (present day South-West Scotland and Northern Ireland). This, too, served aid in conscription of men for warbands (as Dal Riatic society did not formally have a levied army), but interestingly it provided legitimacy for the reigning King or High-King of the state. It is thus regarded as the earliest census in Britain.
About a century after that, the Norman Conquest happens. Twenty years after his campaigns in 1066, the new King William compiled a list of the denizens of England's various shires in what is known today as the Domesday Book. William did this to inventory his holdings as King and survey how taxable his kingdom was (he was greatly enriched by taking England) and report on the holdings of the vassals in homage to him.
In short, censuses have been in use for thousands of years, mainly for the purposes of taxation, conscription, and centralization of authority.
SOURCES:
"Life Application Study Bible, NIV"
"Studies in the History of Dal Riata," by John Bannerman
"Rebellion, Treason, and Political Opposition Under the Anglo Norman and Plantagenet Kings: 1042 - 1352" (Notes from class at University of Glasgow, Autumn 2013), Matthew Strickland.
Censuses are not a modern thing. Even the word is more than two thousand years old, and dates from Rome, where the census would be undertaken under the direction under an elected magistrate called the Censor (who also adjudicated morality, hence the origin of the term being used in that manner). For Ancient Rome, this was imperative because one's role in society politically and military was determined by one's wealth, and thus a fairly regular upkeep of such records was required. Were you eligible to be a Senator? Were you eligible to be an equite? Which station were you in?
The property and military part of this is where ancient and medieval censuses differ from modern ones. The modern census in most countries is driven by the need for accurate demographic information to help direct government policy, whereas ancient and medieval censuses were mostly concerned with, first, having an accurate description of property ownership for taxation purposes, and two, having an accurate number of men available for military service. Ancient Rome provides an especially good example of this, since where and how one served in the Roman legions was determined largely by wealth during the Republican period. Another good example, the 12th century English Domesday Book, was also concerned mostly with property for taxation purposes. Modern censuses still have strong economic drivers, but thanks to increases in data tabulation technology and record keeping, the scope has steadily expanded.