Note the penance can be described as for our spiritual benefit. (try CCC 1460)
Not all the temporal punishment for sins is for sure removed when you go to confession, and yes the penance does go toward that temporal punishment or for satisfaction. But it is not promised to remove it all. Perhaps read about Purgatory or Indulgences as a logical follow up.
CCC 1496 says about the effects of the sacrament: …- remission, at least in part, of temporal punishments resulting from sin…