'I knew I had to help,' cop says of charity act gone viral