The Holy Father is free to give his opinion. Pope John Paul II was also opposed, but for the good reason he had lived through the savagery of the Nazis. That, ironically is why the doctrine of the Church as always allowed the death penally. The state, that is to say, a society has the right to self defense. This goes to war; it goes to the violent criminal.
No, Francis is not free to give his opinion when it contradicts the teachings he’s supposed to be upholding.