Because by looking at the second derivative of a function you are essentially looking at the rate of change of the rate of change. This carries useful information about a function's behaviour and in some sense tells you about the function's "curvature". Specifically, we use the fact that at a stationary point the second derivative can tell us about the nature of the point, i.e. whether it is a local maximum, minimum or inflexion point.