The host galaxies of double compact objects across cosmic time