Unless you’re on a jury voting to put someone to death, or you’re the judge sentencing, or you’re the executioner throwing the switch, then simply having a “belief” that disagrees with a Church moral teaching on this, without more, is not necessarily a sin.
You should however closely examine why your thoughts on this deviate from Church teaching and maybe ask the Lord to help you understand better and to have more charity for your fellow man, including heinous criminals. God loves them too, he just hates the sinful things they do.
You also need to accept the fact that the Church teaches differently from your opinion and that’s just how it is.
It’s no different from Catholics who have opinions contrary to the Church on stuff like gay marriage or women priests.