The answer is yes. Consider instead
$$D^{*} := \limsup_{n, m \to \infty} |T^n f - T^m f|.$$
Clearly $D\geq D^*$ so it suffices to prove the statement for $D^*$ instead. Now $D^{*}$ is $T$ invariant so constant a.e.
But then, consider for $\varepsilon > 0$, the sets $A_+ := \{f \geq \text{esssup } f - \varepsilon\}$, $A_+ := \{f \leq \text{essinf} f +\varepsilon\}$.
By ergodicity, $T^{-j} (A_+ \cap T^{-k} A_-)$ is of nonzero measure for some $j, k$. So
$$D^* \geq \text{esssup } f - \text{essinf }f - 2 \varepsilon$$
for every $\varepsilon > 0$, and sending $\varepsilon \to 0$, we conclude.
Remark: Actually, the condition that the equality for $D_f$ hold for all bounded $f$ is equivalent to ergodicity.