I actually disagree with the premise, the state doesn't care at all whether the executed on death row suffer. During the procedure itself, their main focus is on optics. In some cases, the aim will be to make the execution purposefully brutal, to scare the populace into submission (e.g. public executions). In other cases, they will want to portray the execution as humane or peaceful, because a visibly brutal execution draws attention to the fact that the state gives itself the power to mete out death.
For example, in the United States, the government spends exorbitant amounts of money on lethal injections. Far from being peaceful, this method of execution causes immense suffering during a slow and painful death. However, it appears outwardly peaceful because the drug has a paralyzing effect, so the executee won't display much distress. It is well within the state's resources to use execution methods that are painless, but again, that's not their goal. That's why the US government spends so much money on developing methods that appear to be as painless as possible and only pay lip service to the idea of a humane execution.