Ajanta, having thought some more about your question, I have realised my first answer is rather unsatisfactory.
You might well ask
why it is that a giant structure of C-O bonds is
not a stable arrangement. In fact, if you consider silicon, the element that lies immediately below carbon, in the same group of the Periodic Table, and which has therefore a number of chemical similarities with carbon, a stable giant structure is exactly what is formed by its compound with oxygen. This is SiO2 or quartz - a brittle, very hard mineral, which looks, er, a bit like diamond!
The real reason why carbon oxides do not form such 3D extended structures is the
strength of the C=O double bond. The strength of the C=O bond is far greater than that of the analogous Si=O bond. So, for carbon, a structure with C=O double bonds is more stable than one involving only C-O bonds, whereas for Si the opposite is true.
The next question is why there is this difference between Si and C in their propensity to form double bonds with oxygen. You may or may not know that a double bond involves 2 bonds of different sorts: a "sigma" bond which extends more or less along the line of the two centres of the atoms at either end, and a pi bond which is made of two parts, one above and one below the line of the centres. The pi bond arises from on overlap of p orbitals on the atoms at either end. These p-orbitals extend like dumbbells, at right angles to the line of the atomic centres. The p-orbitals of carbon and oxygen are both 2p, that is, they are from the 2nd shell of electrons around the atom. They are thus of similar size and shape and overlap between them is quite efficient, leading to a strong pi bond. Si however, being in the next period of the table, has
3p orbitals, not 2p. These are larger and more diffuse than 2p and will not overlap efficiently with the 2p orbitals on oxygen, leading to only a weak pi bond.
So there you have it. It is the strength of the double bonding between carbon and oxygen that gives it more energetically favourable options than the formation of a giant structure.
I should probably add that there will also be an entropy term to consider. Formation of a lot of little molecules, each with numerous degrees of freedom, is a higher entropy state that a solid giant structure. So this too will help to tilt the playing field in favour of the gaseous molecular compounds, provided they are energetically stable enough.
Right. That is now a proper answer, I think.