After applying a rotation, current model view matrix will changed with the rotation.
Therefore the second rotation will be applied on the already rotated model view matrix.
After drawing an object with a transformation(rotation,translation,scaling) you have to reset it.
Otherwise next transformation will applied on the transformation applied matrix.
It will provide unexpected object drawing.
glClearColor( 0.5,0.5,0.5,0.5 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glMatrixMode(GL_MODELVIEW_MATRIX);
glPushMatrix();
glRotatef( 15,0, 0, 1 );
glPopMatrix();
glPushMatrix();
glRotatef( 45,0, 0, 1 );
glPopMatrix();