The joke is a pun. Donuts have holes in the center of them.  To say a court case is 'full of holes' means that there is missing evidence or reasoning to come to a conclusion that is trying to be argued in court.
The case against a donut thief was full of holes .