why does the military have their own court
Military justice The United States Constitution authorized the creation of a system of military justice. Article I, Section 8 permits the U.S. Congress to "make rules for the government and regulation of the land and naval forces."[26] Congress issued these rules first in 1806 as the Articles of War. Military justice during the American Civil War was governed by the 1863 Lieber Code. The Articles of War were superseded in 1951 by the Uniform Code of Military Justice (UCMJ).
Officer of the court In the United States, the generic term officer of the court (not to be confused with court officers) is applied to all those who, in some degree in function of their professional or similar qualifications, have a legal part—and hence legal and deontological obligations—in the complex functioning of the judicial system as a whole, in order to forge justice out of the application of the law and the simultaneous pursuit of the legitimate interests of all parties and the general good of society.