Both should be an option. Rehabilitate those you can, imprison those you can, execute those too extreme in their behaviors if needed. Ideally rehabilitation would be the option of choice for everyone, no matter their crimes, but as you rightfully pointed out, some people test our goodness too...