A theory is developed of the density of states (DOS) of the two-dimensional electron gas (2D EG) in semiconductor heterostructures, taking into account the effect of disorder caused by some random field existing in the sample. For a smooth random field, the calculation is carried out within its Gaussian statistics and a semiclassical approach. A simple closed expression thus obtained includes the classical DOS and its quantum correction as well, which describe the DOS of the 2D EG in explicit dependence on the rms of the potential and of the force of the random field. The disorder effect is found to smear out the step-like singularity of the DOS at an unperturbed band edge of the ideal 2D EG into a tail deep below the band edge. A detailed treatment is given of the case when the disorder is due to remote ionized impurities, which are distributed randomly or correlated in the sample.