That's some sloppy police work to put someone on death row.
Unfortunately that sort of thing does happen. Although I wish they'd had the courage to cast the innocent convict as a black man or other minority, a victim of racial profiling and prejudice like so many wrongly convicted death-row inmates are.
Aside from that, though, I liked this one a lot better than most episodes lately. It was neat to see them mix up the formula and have Castle and Alexis be the crimefighting duo instead of Castle and Beckett. I'd like to see it happen more often (or, heck, do a Beckett-Alexis team-up next time). I also liked it that the episode was more serious. I could handle the occasional "weird case inspiring Castle's crazy theories" episode when they were interspersed among more normal cases, but lately they seem to have become the norm themselves, and that's overkill.
I figured out that the inmate was protecting his brother almost as soon as he changed his tune and started acting fatalistic. Although I guess that's not as big a flaw as it could've been, seeing as how the brother didn't really do it.