We numerically investigate the mechanism leading to the entrapment of spheres at the gas–liquid interface after impact. Upon impact onto a liquid pool, a hydrophobic sphere is seen to follow one of the three regimes identified in the experiment (Lee & Kim, Langmuir, vol. 24, 2008, pp. 142–145): sinking, bouncing or being entrapped at the interface. It is important to understand the role of wettability in this process of flow–structure interaction with dynamic wetting, and in particular, to what extent the wettability can determine whether the sphere is entrapped at the interface. For this purpose, a diffuse-interface immersed boundary method is adopted in the numerical simulations. We expand the parameter space considered previously, provide the phase diagrams and identify the key phenomena in the impact dynamics. Then, we propose the scaling models to interpret the critical conditions for the occurrence of sphere entrapment, accounting for the wettability of the sphere. The models are shown to provide a good correlation among the impact inertia of the drop, the surface tension, the wettability and the density ratio of the sphere to the liquid.