The correct option is D was being collected
A sentence is in active voice when the subject is the doer of the action.
A sentence is in passive voice when the new subject (object in active voice) is the receiver of that action.
The given sentence: "Money ___ by them for the needy..." requires a verb in passive voice form.
Option D: 'Was being collected' is in the past continuous tense (passive voice). It states that an action was going on at a point of time in the past. The previous sentence "Soon, two men entered..." suggests that at that point of time, the action "money was being collected" was still going on. They were in the middle of that act during the time. Hence D is the correct option.
Option A: As opposed to D, 'was shocked' is in simple past tense (passive voice). It suggests that an action completed in the past. But, it does not relate to the sentence which mentions a continuing action. Hence A is incorrect.
Option B: 'Had collected' is in the past perfect tense, in the active voice. But, the sentence requires a passive verb. Hence B is incorrect.
Option C: 'Been collected' is incomplete in meaning and structure without the auxiliary or helping verbs 'has/had'. Without either of these helping verbs, the tense cannot be determined. Hence C is incorrect.