Similar to Rex Tillerson, what should have been a good choice turned out to be a disappointment in the end, with some mixed success along the way. I liked Mattis, but he always had a deep state vibe.
When Trump is not choosing a foil character to play off, like John Bolton, he likes to appoint competent people from "central casting." While this usually ensures a fair job is done, it certainly doesn't ensure loyalty by choosing these strong established players.
Mattis did a good job helping to defeat ISIS and he instilled confidence in the troops, as well as the public at the time. Another solid appointment who later back-stabbed was Chief of Staff John Kelly - he did well in the role, but his internal corrupt nature and lack of loyalty overcame him in the end.
These generals are pro-big government, pro-bureaucracy statists to the core. They must sell out to the deep state to some extent to even reach those heights. That is the trade off when dealing with any high level people in the machine, like generals, CEOs, etc. They all must pay the price to their master in the end. Let's stop being surprised.
Mattis is a poser. He is dumping on Trump to get into the Dem money.