In my (inexpert opinion) there are 4 broad categories of criminals:
Crimes that happen in a moment that if that moment hadn't happened, those people would probably never have been criminals e.g.
A lapse of concentration when driving
Getting pulled into a bar fight not of your making and killing someone because they had an unexpected medical condition
An abused person killing their abuser (not exactly the same, but essentially the abused person would be unlikely to be a criminal if they weren't being abused)
etc
Longer sentencing and capital punishment will not reduce this
More educations about consequences, greater police presence (unbiased police presence), greater funding for domestic violence victims, earlier better police intervention may help. Also potentially more education in youngsters, particularly boys to help encourage them not to use violence as a solution.
This is where a prison sentence is almost more of a penance than anything else, a debt to society because these people are highly unlikely to commit another crime.
Crimes of circumstance
If you put people in poverty, with little to no job opportunities, poor educations, a lack of positive role models, with parents who have little time to parent due to trying to survive and provide in poverty, then crime is all but inevitable to an extent.
Longer sentencing and capital punishment will not reduce this.
Better benefits, no zero hours contracts, a living minimum wage, long term investment in education in deprived areas, smaller class sizes, government incentives to bring jobs and free/subsidised sporting options. Bring in IT companies to teach coding, sports companies to teach sports, construction companies to teach construction skills etc. Provide real tangible ways for people to escape poverty and crime. It wont cut down all crime it will reduce it.
If it gets to prison then this is where rehabilitation is much more likely to reduce re-offending than a pure punishment
People with mental illnesses which now end up in the prison system due to poor funding of support services
Longer sentencing and capital punishment will not reduce this type of crime.
Greater funding in mental health, alcoholic and drug rehabilitation services etc will do. Anyone can end up in this category, everyone who has ever had an alcoholic drink had the potential to be an alcoholic, its just medically they aren't. There are parts of the brain/genes etc which dictate can this. And people can be helped, not thrown in prison then released to start the same cycle again.
This is where medical rehabilitation is of more benefit than punishment
Psychopaths
People who rape and kill and fight and steal because they can. Not because they need to, or have been brought up to but because there is something wrong in their brain which means they do.
Longer sentences and capital punishment will not deter these people.
However longer sentences are potentially the only way to prevent reoffences happening. (My personal opinion is that psychopaths are in fact a subset of group 3, in that its a brain wiring issue and a secure medical facility where people are not released unless their medical, in this case mental, issue is shown to be cured, in the same way as people who end up in institutions for crimes due to medical insanity etc, would be the appropriate result)
In general longer sentencing will not prove a deterrent. However early years intervention, money spent on eradicating poverty, greater opportunity and proper rehabilitation can.
So if you are advocating money spent on longer sentencing over money spent on preventing punishment then you are essentially enjoying meting out punishment over stopping crime, that does not make you a good person.