The Pentagon joined the scramble by federal agencies trying to conform to President Trump’s war on diversity programs.