He probably was legally required to answer the census... at least the part that directly related to the enumeration of citizens.
When I received the long census form in the mail, I was not sure what to do, because it asked all kinds of questions that are not related to any kind of lawful enumeration. Further, there was no room for me to add a footnote like "*This question is not reasonably related to an enumeration for election or tax purposes and so is improper." In which case I could have just written that in and put * in all those other places (most of them). So, I must admit, I dithered until an actual person came knocking on my door.
The census-taker asked if I lived here, how long I had lived there, etc. (all quite relevant to an enumeration), and I answered her questions. Then she asked, "can I get your name?" and I said "No." She looked at me kind of funny. I said, "I will answer questions that I believe are reasonably related to an enumeration, but that's all."
To her credit, although she looked exasperated, she did skip over the majority of questions on her form, and only continued to ask things that were relevant (about two more questions). I explained that I was not trying to make her job difficult, but that it was a matter of principle. She seemed to accept that, and went on her way.
This is just a side not but I believe that most government officials have taken an oath to uphold the constitution which gives each employee wide latitude in how the perform their duties. If they believe that some of their duties violates the constitution then they are honor bound to not execute that aspect of their job that violates the constitution. I believe your census worker might have realized that which is to her credit.