Why does the hydrogen atom in HCl (when dissociated in water) bond to the oxygen rather than staying with the chlorine atom?
Look at it from the point of view of the chloride ion. In $\ce{HCl}$, the chloride is attracted to only one hydrogen. But when dissolved in water, the chloride is attracted to the partial positive charges on the hydrogens of several water molecules. Each $\ce{H2O-Cl}$ attraction is less than the $\ce{H-Cl}$ attraction but many of them act together to attract the $\ce{Cl}$ ion away from $\ce{HCl}$. Once the $\ce{Cl}$ is attracted away, that leaves a hydrogen ion to be attracted to the partially negative oxygen of a water molecule.

These forces between multiple waters and an $\ce{HCl}$ are stronger than forces between adjacent $\ce{HCl}$ molecules. Otherwise, $\ce{HCl}$ would be a liquid at room temperature instead of a gas.