That doesn't sound natural in English. Duolingo's system assumes that when you translate from another language into English, you're doing so with English as your first language.
For example, your question would have been marked wrong if it had been given as an answer, because the natural/grammatically correct way would have been "Why is 'who does live in the castle?' wrong?"
'Who does live in the castle?' only works if the emphasis is on 'does,' as in "Oh, he doesn't live in the castle? Who does live in the castle, then?"
Hope this helps :)