Defense Secretary Pete Hegseth has vowed to purge the Pentagon of what he has called “woke” policies and personnel, and to reshape the military’s top ranks.