what causes the different physical properties between HCl and NaCl

2 answers

Electronegativity is one difference so that HCl is primarily a covalent bond (polar covalent) whereas NaCl is an ionic bond.
HCl is a molecular compound with relatively weak intermolecular attractions. It is a gas at room temperature. NaCl is an ionic solid because of the strong ionic attraction between the Na+ and Cl- ions.

The physical properties (state at room temperature, melting and boiling point) are dependent on the strength of cohesive forces. For HCl and other molecular compounds the cohesive forces are intermolecular attractions which are weak with resulting low melting and boiling points.

In ionic substances, the cohesive forces are the electrical attractions between oppositely charged ions. They are strong, resulting in high melting points.