Why are halogens ortho para directing even though deactivating?
Let's take as an example a typical halogen, chlorine. Chlorine withdraws electrons through inductive effect and releases electrons through resonance. Through the inductive effect, chlorine destabilises the intermediate carbocation formed during the electrophilic substitution 



Image courtesy: NCERT Chemistry Class 11th

Through resonance, a halogen tends to stabilise the carbocation, and the effect is more pronounced at ortho- and para- positions. However, the inductive effect is stronger than resonance here, and causes net electron withdrawal and thus net deactivation. The resonance effect tends to oppose the inductive effect for the attack at ortho- and para- positions and hence makes the deactivation less for ortho- and para- attack.

Reactivity is thus controlled by the stronger inductive effect and orientation is controlled by resonance effect.