Any wave function, including orbitals, can host two electrons with opposite spins. This is a property of fermions: they must be in different states, but the spin orientation counts as a part of the state, and since electrons can have two spin orientations, two fit in the same otherwise identical state, which is usually worded as "same state" or "same orbital".
Note A: beware that any detail of the state counts. 2p orbitals can be oriented along x, y or z. So while each orbital 2px, 2py and 2pz can host two electrons with opposed spin, together they host 6 electrons. This is often worded loosely as "the 2p orbital can host 6 electrons".
Note B: molecular orbitals exist as soon as atoms come close to an other, whether the molecule is energetically favourable or not. I proposed it as a possible process for sonoluminescence, where pressure would create excimers or exciplexes that emit light when less strong pressure permits them to split. Temporary molecules, unfavourable due to anti-bonding orbitals, could also result from mere pressure during sonication, and be reaction intermediates. It could also happen in detonations.
Each individual hydrogen atom could host two electrons as a 1s orbital, but there is only one electron. An H2 molecule can host two electrons as the bonding orbital and two as the antibonding. As there are only two electrons, they can occupy both the more favourable bonding orbital.
It is a very efficient reason for atoms to make molecules and explains why lone atoms are extremely rare on Earth - from H to H2 releases more heat than burning H2 to H2O. This spin pairing is not a force between the electrons, it's just the possibility electrons have to rearrange on more favourable molecular orbitals. In a first approximation, valid if the atoms aren't too close, the bonding and anti-bonding orbitals have energies symmetrical below and above the energy of the initial atomic orbitals, so if electrons have to fill the anti-bonding orbital too, the molecule isn't energetically favourable. So helium doesn't make He2 molecules naturally, but hydrogen does make H2.
A molecule can have some electrons on anti-bonding orbitals. For instance, N2 puts all 2p electrons on bonding orbitals and is chemically quite inert, but O2 has two electrons more that must occupy anti-bonding orbitals. O2 is energetically much more favourable than 2O, but is reactive. F2, with two electrons more than O2, is even more reactive. Ne2 doesn't form at all usually.
Older models tell that N2 has a triple bond and O2 a double bond. Molecular orbitals tell that three 2p electron pairs in O2 are on bonding molecular orbitals and one pair on an anti-bonding one, so the formation of O2 releases about as much energy as two bonding orbitals.