In what way was "defect" said to be the correct answer? Were the other three given as possible answers? Or were you specifically asked to fill in an answer without being given this list of options? If it was the latter, which answer did you give?
Any and all of these factors could be the reason that the answer given was 'wrong'...but if it is simply the word listed as 'the answer' in a book, it is also possible that the author of the question did not take synonyms into account, and only gave the one answer as a "correct" answer.
"Demerit" does not make quite as much sense, because a demerit is a factor given to someone, rather than inherent trait as the sentence suggests. And "shortcoming" would require some other context to clarify what shortcoming is being referred to, and if it were then the sentence would have to start with "This" as in "This shortcoming", but it does not. I could see "weakness" being correct, as well as "defect", but these subtle problems for the other two answers makes them lesser choices.
It's also possible you were asked to pick the "best" answer, which would mean the one that is accurate in most cases. In this case, "defect" would cover as broad a range of uses as possible, given no other context to the sentence.