Compact Symmetric Objects (CSOs) show radio features such as jets, lobes, hot spots that are contained within the central 1 kpc region of their host galaxy. Thus, they are thought to be among the progenitors of large-scale radio galaxies. A debate on whether the CSOs are compact primarily because they are young or because they are surrounded by a dense medium impacting their expansion is ongoing. Until now, attempts to discriminate between the environmental and genuine youthfulness scenarios have been inconclusive. We present a study of three CSOs selected on the basis of their puzzling X-ray absorbing properties in prior Beppo-SAX and/or Chandra X-ray Observatory data. Our new XMM-Newton observations unambiguously confirm the nature of their X-ray absorbers. Furthermore, for the first time, our X-ray data reveal the existence of a population of CSOs with intrinsic hydrogen column density $N_H > 10^{23}$ cm$^{-2}$ that is different from the population of X-ray unabsorbed CSOs. The two groups appear to be separated in the linear size vs. radio power plane. This finding suggests that a dense medium in X-ray obscured CSOs may be able to confine the radio jets. Alternatively, X-ray obscured CSOs could be seen as radio brighter than their unobscured counterparts either because they reside in a dense environment or because they have larger jet powers. Our results help constrain the origin of the X-ray emission and the location and size of the X-ray obscurer in CSOs, and indicate that the environment may play a key role during the initial expansion of a radio source.