Propably because a sufficiently large power bloc within these countries was pushing for socialism at the time of creation of their constitutions. Portugal, for example, was prevented from declaring a Peoples Republic by NATO outright sending warships to the capital during their revolution.
Reactionaries then took over in these states