Hydrogen chloride has a simple molecular structure. The atoms within the molecule are held together by strong covalent bonds. However, for simple covalent molecules to melt only the weak intermolecular forces need to be overcome (not the strong covalent bonds). This requires very little energy and thus the melting point is low.
Sodium chloride is a giant ionic lattice. To melt the substance the strong electrostatic attractions between oppositely charged ions (ionic bonds) must be overcome. This requires large amounts of energy and thus the melting point is high.