First, I want to say that I think that the question posed about how to handle job interview questions about family is important, and is answerable within the framework of the site. I've expanded in more detail some of what I said in the comments. Also, I don't have close or reopen vote privileges, and I up voted the original question in any case.
I would say that the title doesn't quite match the body of the question. The question in the title "What is an illegal or/and inappropriate question in a job interview?" has infinitely many answers, and therefore doesn't fit very well in the Q&A format. However, what you're discussing in the body of the question is, in my opinion, focused enough for it to be answerable in the Q&A format.
The other aspect is that the legal question is very specific to location. If you ask "Is it illegal to ask about spouses in a job interview?" and you want answers for both the USA and the UK, these are basically different questions. The site discourages asking multiple questions in a single question. Aside from this, I think the legal question may not be best suited to this site. In my opinion, it might get better answers on workplace.stackexchange.com, although having said this, the Stack Exchange network in general shies away from legal advice. Still, I think this question is a valid to ask here and should not be closed provided it is asking about a single location.
Apart from the legal question, you also asked "How should I respond to these questions as an early stage career academic?". To me, this is the part of the question which this site is best equipped to answer. As you said, even if the question is illegal, you still need to handle it somehow if it's sprung upon you. It perhaps could have some geographical focus, but I think it doesn't need to have one to be a valid question.
In summary, to me, the legal question and the "how to handle this" questions are separate, and should be split off into separate questions. The "how to handle this" question is good, and is exactly the sort of question this site ought to be able to provoke good answers for.