Defense Secretary Pete Hegseth has derided diversity programs in the military and has fired senior officers linked to them.