Trump said the diversity programs discourage merit and leadership, and discriminate on the basis of race and sex. The directive was among a series of orders that seeks to reshape the U.S. military.