The answer to the riddle is Because the woman suspected that if he really thought it was his room then he wouldn’t have knocked at the door. The man might have an intention to break in, in order to steal something, if no one was in the room. He knocked to make sure that no one was in there.