As far as the state is concerned, the statutory respect for the seal of confession is intended to protect the penitent, not the confessor (although an unscrupulous confessor could certainly take advantage of the privilege in order to protect himself, if he did something wrong in the confessional). As far as I can tell, the same is true as far as Canon Law is concerned: the seal of confession is there to protect the penitent, not the confessor.
However, a penitent may give a priest permission to talk about what was confessed. The penitent may release him from the seal. And this is why the recent legal case in Louisiana doesn’t quite make sense to me.