The firing comes amid Trump’s pledge to reshape the U.S. military and rid the nation of what he calls “woke” generals.