Here we built up a sample of 22 GRBs at redshifts $z > 2$ observed with X-shooter to determine the abundances of hydrogen, metals, dust, and molecular species. This allows us to study the metallicity and dust depletion effects in the neutral ISM at high redshift and to answer the question whether (and why) there might be a lack of H$_2$ in GRB-DLAs. We fit absorption lines and measure the column densities of different metal species as well as atomic and molecular hydrogen. The derived relative abundances are used to fit dust depletion sequences and determine the dust-to-metals ratio and the host-galaxy intrinsic visual extinction. There is no lack of H$_2$-bearing GRB-DLAs. We detect absorption lines from H$_2$ in 6 out of 22 GRB afterglow spectra, with molecular fractions ranging between $fsimeq 5cdot10^{-5}$ and $fsimeq 0.04$, and claim tentative detections in three other cases. The GRB-DLAs in the present sample have on average low metallicities ($mathrm{[X/H]}approx -1.3$), comparable to the rare population of QSO-ESDLAs (log N(HI) $> 21.5$). H$_2$-bearing GRB-DLAs are found to be associated with significant dust extinction, $A_V > 0.1$ mag, and have dust-to-metals ratios DTM$ > 0.4$. All of these systems exhibit column densities of log N(HI) $> 21.7$. The overall fraction of H$_2$ detections is $ge 27$% (41% including tentative detections), which is three times larger than in the general population of QSO-DLAs. For $2<z<4$, and for log N(HI) $> 21.7$, the H$_2$ detection fraction is 60-80% in GRB-DLAs as well as in extremely strong QSO-DLAs. This is likely a consequence of the fact that both GRB- and QSO-DLAs with high N(HI) probe sight-lines with small impact parameters that indicate that the absorbing gas is associated with the inner regions of the absorbing galaxy, where the gas pressure is higher and the conversion of HI to H$_2$ takes place.