Reasoning: My guess would have to be that it has to do with the strength of the intermolecular forces between each molecule. For example, molecular compounds that have a very low molar mass like $\ce{CO}$ and $\ce{CH4}$. Both of theses molecules have a very small molar mass, a very low London dispersion force, and thus a very low boiling point. This in turns makes it easier to break the bonds that hold each individual atom and more than likely cause them to turn into a gas in normal conditions.
Then when you look at ionic compounds like $\ce{MgCl2}$ and $\ce{NaCl}$, it is more likely for these compounds to become solid because of the strong intermolecular force that they have (ionic bonds).
Is my reasoning correct and is there something else that I should consider?