We know Valency of oxygen is 2 and valency of hydrogen is 1 so when hydrogen react with oxygen two hydrogen atom form 2 single bond with oxygen and formform H2O,whereas chlorine has valency 1 so only one hydrogen required to complete the octate and form hydride of chorine HCl
Hydride of oxygen H2O
2H2 + O2 ---> 2H2O
Hydride of chlorine- HCl
H2+Cl2 --> 2HCl