The House passed a defense policy bill that included a provision to ban certain medical care for transgender children of military service members.