Here's why:
* Ionic compounds are formed when a metal (which readily loses electrons) and a nonmetal (which readily gains electrons) react. The metal loses electrons to form a positively charged ion (cation), and the nonmetal gains electrons to form a negatively charged ion (anion). These oppositely charged ions are then attracted to each other, forming an ionic bond.
* Oxygen (O2) and chlorine (Cl2) are both nonmetals. They do not form ions with each other. Instead, they share electrons to form a covalent bond. This sharing of electrons results in a molecule with a neutral charge.
Therefore, oxygen and chlorine exist as diatomic molecules (O2 and Cl2) due to covalent bonding, not ionic bonding.