Metals form ionic compound because they are highly electropositive in nature. By lossing 1,2 or 3 electron(s) they become stable and form ionic bond. It is for them to lose electrons to complete their octet by forming ion, rather than sharing of electrons.