A tool cannot have inherent moral goodness or lack it. A tool is inanimate. It is amoral. By itself it does nothing. Only humans can put tools to uses that may be good or bad for other humans. Morality does not exist outside of human perception.
I disagree. A registry of Muslim/Jewish/... people is a tool with inherent discrimination, which has next to no known good use for society. Only for evil.
In a proper census you do not collect proven-sensitive information together with identifiable information, that's the difference.
A database with a direct link between identity and religion can only be used for nefarious purposes.