^In Spock's case, the crime was real. There was a murder. They knew the quilty party was on the Enterprise. Kirk and Bones' lives were at stake, and the fate of this part of the Galaxy was at stake too. So Spock had to do it.
The hearing in The Drumhead was more of a farce, no evidence of an actual crime the whole time.