What do you call someone or something that is the best in a group of bad people or bad things? For example, a prisoner who is the best in terms of behavior in the prison, even though we know that all prisoners (including the best prisoner) are bad people.
All existing answers are effectively popular/slang expressions (and "best of a bad lot" doesn't work for Brits, who invariably use "best of a bad bunch"). If OP wants an alternative suitable for a somewhat more "up-market" context...
faute de mieux - for want of something better; for lack of an alternative.
...will often be suitable. Note that we don't say "this prisoner is faute de mieux" - you need to phrase it as something like "I'll have to make this prisoner a trustee, faute de mieux". Also note that the French origin is still generally acknowledged by italicising the written form - but here are nearly 20,000 written instances, showing that it's commonly used by Anglophones.
As others have noted, lesser of two evils seems to be the best match for the concept you're looking for. I don't know of a perfect way to extrapolate the concept beyond two people, but the term lesser evil comes to mind. While it still suggests two, it's less explicit. That term also sees considerably more use than least evil or least of all evils, which seem appropriate but feel awkward to use.
I'm as stumped as Barrie for a single word, but some idioms and expressions come to mind:
- Diamond in the rough (defined by the M-W online dictionary as one having exceptional qualities or potential but lacking refinement or polish)
- Ugly Ducking (defined as one that appears very unpromising but often has great potential)
- Sole bright spot (or lone bright spot), bright spot being defined as a pleasant or successful event or period of time when most other things are unpleasant or not successful (TFD). Though usually applied to circumstances or events, I think that phrase could be applied to a person as well:
Of all the no-good scoundrels the warden inspected that first day in the prison courtyard, Finnegan Jones was the lone bright spot.
I'm also stumped for a single word for what you require but immediate word associations that come to mind when I consider the phrase 'best of a bad bunch' is unsavoury characters therefore perhaps you could consider least unsavoury or similar synonyms to convey he is bad but not as bad others.
Alternate idioms or words for "lesser of two evils" might also lead you to the single word you're looking for.
It's not much help I know but it does remove the unconscious connotation that the person is almost too good for his nasty peers which 'best of a bad group' may imply.
The least-worst: bad but better than any available alternative