With time, I have come to realize that giving to charity is not a good measure of goodness. In statistical terms, it would be if the data was not biased. However, that's not true.
A lot of religious institutions tell followers that charity is required by God, and doing charity would make them more liked by God (and hence you will get a better treatment in after-life). This makes it very difficult to compare the data across the two groups.