Two cases in the media recently where people wrongly convicted, according to law anyway, have been refused compensation after spending time in jail.
The major one was the case of the man accused of murdering Jill Dando, Barry George. It seemed obvious ten years back that the case was flimsy at best, not sure how a jury could convict on the evidence presented. The judge who refused compensation has effectively said we think you are guilty but can't prove it. The second case was woman in prison because she was thought to have shaken her baby to death. Again no compensation.
In my mind payment should be automatic, if occasionally this means someone who actually 'did it' gets paid so be it.