On the one hand, privacy gives people leeway for free thought, freedom of expression, and criticism without fear of personal consequences.
On the other hand, security ensures the structural integrity of society and grants citizens a sense of safety, which translates into stability.
Previously, law enforcement with few exceptions did not have to think much about what sort of data to collect, since surveillance resources were limited and had to be used in a directed fashion to be effective at all. Nowadays, as China is demonstrating with their extensive camera coverage and social credit system, the boundaries of state knowledge seem out of sight.
Though it is easy to criticize China for their in many ways immoral social credit system, simultaneously they are doing pioneer work in modern law enforcement by exploring extreme surveillance. Western nations will soon also face questions of when and where to install cameras, under which conditions to perform facial recognition, and which social spheres law enforcement may inspect.
Theoretically, a perfectly just government could collect all the data it wanted and use it sensibly, but since data persists, even if we had such a perfect state, successive governments could misuse extensive citizen profiles to establish an authoritarian regime, for example through tailored propaganda and selective law enforcement.
In conclusion, maximal security implies stagnation of societal development, while maximal privacy gives rise to unlimited crime. How much information can the state be trusted with? Where do you draw the line? Is there already a consensus out there for where the line should be drawn?