The proper purpose of a trial, whether civilian or military, is primarily to determine the truth, secondarily to punish lawbreakers.
The frequent purpose of a trial, whether civilian or military, is to hang a scapegoat and the truth be damned.
You could ask Lee Harvey Oswald about that if he were available to comment.