We study the morphological and structural properties of the host galaxies associated with 57 optically selected luminous type 2 active galactic nuclei (AGNs) at z~0.3-0.4: 16 high-luminosity Seyfert 2 [HLSy2, 8.0=<log(L_[OIII]_/L_{sun}_)<8.3] and 41 obscured [QSO2, log(L_[OIII]_/L_{sun}_)>=8.3] quasars. With this work, the total number of QSO2s at z<1 with parametrized galaxies increases from ~35 to 76. Our analysis is based on Hubble Space Telescope WFPC2 and ACS images that we fit with galfit. HLSy2s and QSO2s show a wide diversity of galaxy hosts. The main difference lies in the higher incidence of highly disturbed systems among QSO2s. This is consistent with a scenario in which galaxy interactions are the dominant mechanism triggering nuclear activity at the highest AGN power. There is a strong dependence of galaxy properties with AGN power (assuming L_[OIII]_ is an adequate proxy). The relative contribution of the spheroidal component to the total galaxy light (B/T) increases with L_[OIII]_. While systems dominated by the spheroidal component spread across the total range of L_[OIII]_, most disc-dominated galaxies concentrate at log(L_[OIII]_/L_{sun}_)<8.6. This is expected if more powerful AGNs are powered by more massive black holes which are hosted by more massive bulges or spheroids. The average galaxy sizes (<r_e_>) are 5.0+/-1.5kpc for HLSy2s and 3.9+/-0.6kpc for HLSy2s and QSO2s, respectively. These are significantly smaller than those found for QSO1s and narrow-line radio galaxies at similar z. We put the results of our work in the context of related studies of AGNs with quasar-like luminosities.