The smartest thing for them to have done was just to let him retire. An officer can retire in as little as about ten days. Knew a guy who retired in nine days; God knows why. He goes away, writes his book, whatever. Instead, he makes his rants, pisses off the command, and has UCMJ charges filed against him. There's a court-martial, he's convicted and probably, at a minimum, dismissed from the service. For an officer to be dismissed is the equivalent of a dishonorable discharge. But the stain on the Marines' honor for treating this officer the way they did won't go away soon or easily.
I see a lot of officers retiring at the 20-year mark now, even those who probably had a good shot at higher ranks. Not all officers are political sycophants. But the higher you go, the more "political" you end up being.