Adversarial process at work. Each side works against each other as hard as they can within the bounds of law and the jury (or just judge, depending) decides.
It’s ridiculous, but the defense attorney working as hard as possible against the prosecution. If there’s even a tiny hope of it working it’s worth trying.