Organosilicate glasses (OSGs) are used as low-k intermetal dielectrics for advanced integrated circuits. In this application, the material must fulfill two conflicting requirements: It has to have low density to reduce the dielectric constant while being sufficiently mechanically stable to withstand thermomechanical and other stresses during subsequent steps of integrated circuit manufacture. Recent experimental advances in improving the mechanical and electrical properties of these materials have not yet been systematically studied theoretically at the ab initio level due to the large model sizes necessary to realistically describe amorphous materials. In this paper we employ the density-functional-based tight-binding method to achieve an accurate description of OSG properties at different compositions. We analyze the influence of composition and local network defects on the density and bulk modulus of nonporous OSG. We find that the dependence of density and that of mechanical stiffness on chemical composition are of different natures. This difference is traced to a transition between mechanisms of elastic deformation in silica glass and in silicon hydrocarbide, which is also the reason for the two materials' different sensitivities to network defects.