The pay was good, and that was the only reason they took part in the study.
Literal
Reward [topic-は] was-good, and that-fact [subject-が] they [subject-が] that research [to-に] participated only motivation was
そのことが = 'that fact' as main-clause subject. The relative clause 彼らがその研究に参加した modifies 唯一の動機 (the only motivation). Note double が: the outer marks そのこと as main subject, the inner marks 彼ら within the relative clause.