At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
atoms that form covalent compounds have to share their valence electrons to become stable. metals don't need to gain electrons to become stable, they would rather "give up" their valence electrons, which is what makes ionic bonds, not covalent bonds.
They do. What you may be asking is why they don't form very many molecular compounds. The answer is that, first, when metals, particularly from the left side of the Table, react with nonmetals, the nonmetal's electronegativity is so high they typically simply steal the metal's valence electrons, and you get ionic compounds. Secondly, when metals react with low electronegativity elements, particularly other metals, they happily form covalent bonds, in the sense of sharing electrons, but these are unusual bonds in several important ways, and it becomes easier to describe them in terms of what are called "metallic bonds" and the compounds formed (metals and metal alloys) don't have identifiable molecular subunits. That said, there are still some compounds of metals that definitely deserve to be called molecular, e.g. TiCl4