This is testing what is known as the "contrapositive" in logic. That's something you encounter more often in CR questions than in Quant questions, at least explicitly.
If you have a true statement, in the form "If X is true, then Y is true", then it is always logically correct to deduce the "contrapositive" of that statement. The contrapositive will read: "If Y is NOT true, then X is NOT true". Notice we need both to negate each of X and Y, and also to reverse the If/then statement.
If you try doing that for any true If/Then sentence, you'll see that you're always making a logically correct inference. Take "if x = 3, then x^2 = 9", for example -- the contrapositive says "If x^2 is not 9, then x is not 3", which is clearly also true. Or, if we assume it's true that "if it is raining, there are clouds in the sky", then it would be logically correct to conclude "if there are no clouds in the sky, it is not raining".
So in this question, we know "If you get all of your multiple choice questions right, you get an A". The contrapositive says "If you don't get an A, you didn't get all of your multiple choice questions right". So answer B is a logically correct deduction. For all of the other answer choices, we can imagine scenarios where the information in the stem is true but the answer is false. For answer D, for example -- "If Lewis received an A, then he got all of the multiple choice questions right" -- the question does not tell us that this is the
only way to get an A. Perhaps you can also get an A with one wrong multiple choice answer, say. And answer C is identical to answer D, logically, since it is the contrapositive of answer D, so it is wrong for the same reason.