Why don't two carbon atoms form a molecule with four covalent bonds?
As usual in chemistry, we are explaining an experimental fact by using an
explanatory model. The reasoning, however, has to be based on a more
sophisticated model than the Lewis structures we usually use. I will
present the three common models in turn, below, and you may stop when you
reach an explanation that's too complicated!

From a Lewis point of view, there is no reason why carbon can't form a
quadruple bond:

This model satisfies the Octet Rule and leaves no electrons for further
bonding. But it implies that C2 is a
perfectly stable molecule, like N2,
and that just isn't the case. C2 is
highly reactive and can only be studied under high-vacuum conditions, when
it can avoid meeting other molecules for long enough to be detected.

If we go on to the valence-bond model, in which bonds result from
the overlap of atomic orbitals, we see a better explanation: carbon cannot
form a quadruple bond because it doesn't have enough atomic orbitals
pointing in the right directions. Furthermore, the s atomic orbitals
must be hybridized (as sp3,
sp2 or sp hybrids) so that they may
point in some direction.

Transition metals are able to form quadruple bonds because they can involve
d atomic orbitals in bonding. A quadruple bond requires one s bond, two p bonds and a d
bond (between two unhybridized d orbitals).

Valence-bond theory predicts two possible bonding states for C2: a double bond with all electrons
paired, and a triple bond with two unpaired electrons. These are called
resonance structures, and both must be considered
as partial representations of the real situation. The Lewis representations
are shown below. For the orbital overlap picture, compare that in carbon monoxide.

Finally, we can visit the molecular-orbital model. Although this
model is not required to explain why carbon can't form quadruple bonds, it
is required to explain why C2 actually forms only a double bond (!!) and has a
triplet ground spectroscopic state (3Pu), in which two of the electrons are
unpaired. Valence-bond theory predicts either an
all-electrons-paired double bond, or a two-unpaired-electrons
triple bond, but not both!

To understand this, we need to recognize that

in molecular-orbital theory, molecular orbitals are formed from the
overlap of atomic orbitals before they are occupied. s orbitals are formed by the combination
of two atomic s orbitals, or by two p orbitals laid end-to-end; p orbitals are formed by the combination
of two atomic p orbitals laid side-by-side.

Furthermore, each pair of atomic orbitals produces one bonding
molecular orbital and one antibonding molecular orbital; if bonding
and antibonding molecular orbitals are occupied, there is no net
bond.

Finally, while electrons normally pair up in molecular orbitals, it
takes energy to make them occupy the same orbital ("correlation
energy") and sometimes it takes less energy to put them in different
orbitals than it does to put them in the same one.

Homonuclear diatomic molecules (that is, molecules with two atoms
only, and those of the same element) have the following molecular orbitals.

Two carbon atoms have a total of 12 (6+6) electrons; when we put 12
electrons into the molecular orbital diagram we at first expect all
electrons to be paired:

However, the experimental fact is that C2 has a 3Pu ground state, so two electrons must be unpaired. We
explain this by noting that the 2pp and 2ps molecular
orbitals are quite close in energy, so it takes more energy to pair the
electrons than to put one in a slightly higher orbital. The resulting
molecular-orbital model of C2 is

Notice that both molecular-orbital models show a net
double bond between the carbon atoms.

To summarize:

To answer your question, we have to go beyond Lewis structures.

Valence-bond theory answers your question by picturing C2 as a pair of resonance structures,
neither of which have a quadruple bond:

To explain all the spectroscopic facts about C2, we have to go to a molecular-orbital
model, which depicts C2 as rather
like O2: only a double bond, but two
unpaired electrons.