The principle tells us that one should not praise an act of apparent generosity unless you believe it is performed out of selfless motives.
should praise an act -> believe performed out of selfless motives ~ believe performed out of selfless motives -> should not praise
and you should not condemn an act of selfishness unless you believe it is performed out of self-centered motives.
should condemn an act-> believe performed out of self-centered motives ~ believe performed out of self-centered motives -> ~ should not condemn
(B) describes a scenario where Sarah chooses not to praise Michael because her motive to TELL her is selfish, he tells her to impress her, but we cannot infer that the act itself - donating a tenth of his income is not selfless. The principle only relates to the charitable ACT itself, whereas (B) looks at one's motives for telling about his charitable act.
(D) demonstrates a clear connection between the charitable act - offering to share the house - and the decision not to praise.