As the purpose of penance is to rebuild and uplift someone spiritually, and not to pay back some debt, the concept of doing penance for another person seems rather absurd. However, considering the example that you gave perhaps he saw that they were overly distraught and he needed to reassure them, or that they were not repentant and needed to make them feel guilty...I could see numerous pastoral reasons for such a statement.