This was a case of national security, something to do with secrecy about canons.
All the evidence had shown that state secrets were sold to a foreign power.
Judge Lestrade certainly would have found him guilty and would have sentenced him to the firing squad if it hadn’t been for the world famous detective Moriarty and his brilliant assistant Mrs Hudson. They countered all the incriminating material which now acquited the accused and finally they revealed what no one could have ever suspected: Watson, the butler, did it.