At the end of the Vietnam War, I served in the office of the Judge Advocate General for the Marine Corps' Second Air Wing at Cherry Point, North Carolina. During my two years working in the courtroom there I became quite well acquainted with the military's Uniform Code of Military Justice (UCMJ). One thing I came away with is that the system of justice in the military is far more efficient than its counterparts in the state and federal systems, and it is much less tolerant of liberal interpretation. That is one reason it surprises me when so many general officers in all branches of the military exercised verbal expressions of dissent and condemnation against the President of the United States without consequence.
According to the UCMJ, that's just not something that officers are at liberty to do. Despite the First Amendment's assurance in the Constitution that all citizens have freedom of expression in a general sense, there is no freedom of speech in the military, by law. Below is text of Article 88 from the UCMJ that strictly forbids condemnation of officials in the chain of command with a defined prescription of court martial in the event of a breach of the oath sworn to by every military official. Essential military discipline is only maintained by upholding the law and punishing those who break it. If charges are not drawn up against those officers who have condemned the President both verbally and in writing, then it is only by the grace of the President toward those who have dissented.
Article 88: “Any commissioned officer who uses contemptuous words against the President, the Vice President, Congress, the Secretary of Defense, the Secretary of a military department, the Secretary of Homeland Security, or the Governor or legislature of any State, Commonwealth, or possession in which he is on duty or present shall be punished as a court-martial may direct.”