Molecular oxygen is O2. It is two oxygen atoms covalently bonded together by a double bond. The reason that they are not bonded together by a single bond is due to the number of valence electrons in oxygen and also by the octet rule.
The valence electrons for any atom are the electrons in its outermost energy shell. These are the electrons that are available for chemical reactions and bonding. Oxygen has six electrons in its valence shell. This means that two oxygen atoms together have 12 valence electrons. If 4 of the electrons are utilized for a double bond, then that means that 8 electrons are left, or 4 per oxygen atom. So each atom can have 2 lone pairs and the double bond. This sums up to 8 electrons surrounding each atom (4 from the lone pairs and 4 from the double bond), so that gives each oxygen atom an octet of electrons surrounding it, which is the most stable configuration for an atom (a total of 8 electrons fills its valence orbitals).