Indeed. I used to be a budget analyst for the state legislature in my state, and the cost for the various procedures that are followed in the event the prosecutor is asking for a death sentence runs about a million dollars. The extra costs cover a very thorough audit of the process, from initial investigation through final sentencing, and the costs of the appeals up through several levels of courts. State prison costs run about $35K per year per inmate, so that million dollars would cover almost 30 years of incarceration. The entire legal process from beginning to end typically takes ten years, so the state will pay for 10 years incarceration in addition to the million.
The death sentence is seldom sought. We do have one case in progress now where the prosecutor is seeking the death sentence; the accused killed 12 and injured 70 in a mass shooting. I can fairly safely say that the accused did it, as he offered, through his attorney, to plead guilty if the sentence was life without parole. After almost three years, the case has reached jury selection. The trial will be a travesty of dueling experts arguing over whether the accused was insane at the time or not. I figure there's a fair chance the verdict will be not guilty by reason of insanity, and he'll still get life without parole despite all the bills the prosecutor is racking up.