Why is O2 a molecule?
Because it fits the definition of molecule which is "two or more atoms of the same or of different elements bonded together".
A molecule is two or more atoms of the same or of different elements bonded together with chemical bonds.
Molecules may be simple (a few atoms) or complex (many atoms).
When a molecule is formed of different elements, it is called a compound.
Examples of molecules are:
#O_2#- a simple molecule comprising two atoms of oxygen. #N_2#- a simple molecule comprising two atoms of nitrogen. #H_2O#- a simple compound molecule comprising two atoms of hydrogen and one atom of oxygen (water). #C_6H_12O_6#- a complex compound molecule (glucose)
Atoms react in order to become more stable, an oxygen molecule is energetically more stable than two oxygen atoms.
The O double bond O bond is strong and this means that, in the absence of something else to react with, eg a metal or hydrogen, two oxygen atoms will readily react with one another to form an oxygen molecule. In simple terms, by sharing tow pairs of bonding electrons, the two oxygens in the molecule achieve full orbitals, which makes them more stable i.e. the molecule is at a lower energy level than the individual atoms.