I think it’s useful to collect this data, both for administrative purposes, and external research purposes.
I’m unsure, currently, exactly what data should be collected by the censuses (that would be proposed and discussed here). The data that is collected, should be collected anonymously.
I am by no means an expert on the subject, but I presume that there are methods that can be employed to filter out bad-faith respondents.