Context. The morphology and the distribution of material observed in supernova remnants (SNRs) reflect the interaction of the supernova (SN) blast wave with the ambient environment, the physical processes associated with the SN explosion, and the internal structure of the progenitor star. IC 443 is a mixed-morphology (MM) SNR located in a quite complex environment: it interacts with a molecular cloud in the northwestern and southeastern areas and with an atomic cloud in the northeast. Aims. In this work, we aim to investigate the origin of the complex morphology and multi-thermal X-ray emission observed in SNR IC 443 through the study of the effect of the inhomogeneous ambient medium in shaping its observed structure and an exploration of the main parameters characterizing the remnant. Methods. We developed a 3D hydrodynamic (HD) model for IC 443, which describes the interaction of the SNR with the environment, parametrized in agreement with the results of the multi-wavelength data analysis. We performed an ample exploration of the parameter space describing the initial blast wave and the environment, including the mass of the ejecta, the energy and position of the explosion, as well as the density, structure, and geometry of the surrounding clouds. From the simulations, we synthesized the X-ray emission maps and spectra and compared them with actual X-ray data collected by XMM-Newton. Results. Our model explains the origin of the complex X-ray morphology of SNR IC 443 in a natural way, with the ability to reproduce, for the first time, most of the observed features, including the centrally-peaked X-ray morphology (characteristic of MM SNRs) when considering the origin of the explosion at the position where the pulsar wind nebula CXOU J061705.3+222127 was at the time of the explosion. In the model that best reproduces the observations, the mass of the ejecta and the energy of the explosion are ~7 M⊙ and ~1 × 1051 erg, respectively. From the exploration of the parameter space, we find that the density of the clouds is n > 300 cm−3 and that the age of SNR IC 443 is ~8000 yr. Conclusions. The observed inhomogeneous ambient medium is the main property responsible for the complex structure and the X-ray morphology of SNR IC 443, resulting in a very asymmetric distribution of the ejecta due to the off-centered location of the explosion inside the cavity formed by the clouds. It can be argued that the centrally peaked morphology (typical of MM SNRs) is a natural consequence of the interaction with the complex environment. A combination of high resolution X-ray observations and accurate 3D HD modeling is needed to confirm whether this scenario is applicable to other MM SNRs.