Lawmakers, military officials and civil rights groups all slammed the policy barring most transgender people from military service.