Formation of halohydrin vs alkyl dihalide
The halohydrin is usually formed by means of a solvolysis reaction where water is used as the solvent. So, it is present in such high amounts that it overpowers the larger nucleophilic strength of the $\ce{X-}$ ion since the latter is only present in relatively minute quantities. Furthermore, water is a polar protic solvent and thus it has the effect of weakening the nucleophilic strength of $\ce{X-}$ in solution by "encasing" it in a large hydration shell.