What you’re experiencing is called “z-fighting”, and as @dashandslash suggests, this has to do with depth buffer precision. If you specify an unusually large range (e.g. you want to render everything from 1 micrometer to 1 lightyear in the distance), the floating point precision of the buffer will not be able to distinguish between planes that are close to each other.
What makes matters worse is that depth is non-linear: there is much more precision available close to the near plane than there is further away from the near plane. A good article about it can be found here.
The solution is to tweak the depth range, especially the near plane distance. Make it as large as you can. And also reduce the far plane distance.
If that’s not enough, make sure to use the highest depth buffer precision available. The default (I think) currently is 24 bit with 8 bits stencil mask (
GL_DEPTH24_STENCIL8). If you don’t need the stencil buffer, try
GL_DEPTH_COMPONENT32 or even
GL_DEPTH_COMPONENT32F. Note that this may have an effect on performance, so test this.
Finally, if all else fails, try looking into “reverse depth”, as mentioned in this article. This, however, is pretty advanced stuff, so try adjusting the near plane first.