Everyone is entitled to a defense, even the worst of criminals. Think of the alternative, if we didn't provide for a defense, then LE and the courts could just say, "you're guilty, go to jail!" to anyone they felt like, whether guilty or not. No, we don't want that.
The defense team isn't just defending the criminal but making sure the judicial process is fair and conducted properly and transparently for everyone. And the yucky criminals benefit. (And we all do, as a society, in the bigger picture.)
jmo