Yup, metals are held together by metallic bonding which essentially means that each atom in the metal "shares" electrons with all the other atoms around it. An atom cannot stray far from its neighbors in a pure metal because if it did so it wouldn't be able to benefit from or contribute to this sea of electrons. So the density of a metal is limited by how far one atom can stray form another without disrupting the electron sea.
In contrast, most nonmetal gases form discrete molecules where the bonds formed are covalent and localized between only a few atoms. It is easy for instance for a single molecule of O2 to stray quite far away from another molecule of O2 since the two molecules are not strongly attached to each other. This ability allows a sample of oxygen gas to have a lower density at normal temperatures than a metal; it can spread out to fill space much more easily.