Not every word he utters...:doh
The pope is a man--a very holy man, but he's a man. When he speaks "from the chair of Peter" (ex cathedra, as ludahai already mentioned) then it is with the authority granted him by Jesus where He said, "Truly, I say to you, whatever you bind on earth shall be bound in heaven, and whatever you loose on earth shall be loosed in heaven." Only then is the pope speaking infallably on matters of faith and morals.
More in the Catechism...
Capital Punishment
2266 The State's effort to contain the spread of behaviors injurious to human rights and the fundamental rules of civil coexistence corresponds to the requirement of watching over the common good. Legitimate public authority has the right and duty to inflict penalties commensurate with the gravity of the crime. The primary scope of the penalty is to redress the disorder caused by the offense. When his punishment is voluntarily accepted by the offender, it takes on the value of expiation. Moreover, punishment, in addition to preserving public order and the safety of persons, has a medicinal scope: as far as possible it should contribute to the correction of the offender.[67]
2267 The traditional teaching of the Church does not exclude, presupposing full ascertainment of the identity and responsibility of the offender, recourse to the death penalty, when this is the only practicable way to defend the lives of human beings effectively against the aggressor.
"If, instead, bloodless means are sufficient to defend against the aggressor and to protect the safety of persons, public authority should limit itself to such means, because they better correspond to the concrete conditions of the common good and are more in conformity to the dignity of the human person.
"Today, in fact, given the means at the State's disposal to effectively repress crime by rendering inoffensive the one who has committed it, without depriving him definitively of the possibility of redeeming himself, cases of absolute necessity for suppression of the offender 'today ... are very rare, if not practically non-existent.' [68]