Let's face it, if you became a 'non-person' by not having an ID card when they become compulsory, and therefore have no right to access any government services etc... they'd be a bit cheeky to expect tax!
Prostitution is not unlawful, but I believe there have been decided cases where the right of the Revenue to tax the income has been maintained, but certain claims for expenses not allowed to be offset against tax liabilities.
One good reason for knowing who people are and where they are has always been so as to tax either themselves (poll taxes), their work or earnings, their capital, and their land. And of course sales taxes, once you move from a tax on sales to a value added tax.
The real reasons for the NIS/NIR are a mixture of control (sought for centuries) and taxation (ditto).
Not quite half