Someone may help build a mosque or support an educational initiative while still having serious faults. The useful contribution may be acknowledged without approving that person's wrongdoing.
Example 1: A person provides space for a learning center. The center benefits, but the contribution does not certify every aspect of the donor's conduct.
Example 2: A community benefits from a person's particular skill while still recognizing the need for moral reform.
In هَذَا الدِّينَ, هَذَا is a demonstrative, “this,” and الدِّينَ identifies the religion being referred to.