Dear student
Halogens have the outer most electronic configuration as ns2np5. That means they can just gain one electron to acquire the stable noble gas configuration. They can both form ionic as well as covalent bond but in both the cases they can just gain or share one electron. This is the reason that the halogens will have an odd oxidation state only.
Regards