The way one treats criminals should be dependent on a number of parameters. Today, justice is considered justice only if the punishment or deterrent is tailored to fit the crime. To a minor degree, it must also be tailored to fit the criminal, as a difference is often made between adult, underage, and mentally deficient perpetrators. Sometimes things like age, physical health or gender also make a difference.
Yet in the Star Trek context, the latter set of parameters would be much more prominent. Imprisonment of a given length means vastly different things to entities with different lifespans or paces of life. Taking of life gets complicated when the criminal has several. Etc.
Holographic criminals might be a new thing as of 2364 - but there might already be some precedent of criminal software by then. Imprisonment would be a rather meaningless punishment or deterrent; death, likewise. Cyber-lobotomy might work reasonably well, and be comparable to the gold standard of "Dagger of the Mind", that of curing the mental illness that drove the perp to the crime. Still, different software criminals would pose different challenges of punishment or deterrent, and it's not objectionable to see Picard stymied by the specific challenge posed by Moriarty...