I was hoping an expert would have commented on this. In any case, from my understanding, it boils down to purity. One sees this by global considerations: look at the fiber over the Hitchin base $\mathcal A_G$; by the BBDG decomposition theorem the complex $f_*\bar{\mathbb Q}_\ell$ is a direct sum of simple perverse factors, and the purity theorem tells us that the eigenvalues of the Frobenius action of each summand is a power of $q$. Then somehow (and this is where my answer is unsatisfactory) when you put this together in the Lefschetz Trace Fromula, the factor of $q$ is exactly as we see it.
Ngô proves this 'by hand' for a 'good' open subset of the anisotropic locus, i.e., he verifies some special cases of this, then by a continuity argument is able to extend this over the entire locus.
Now the exact power of $q$, I believe, is coming from the choice of certain divisors denoted $\mathfrak D_H+\mathfrak R^H_G$$\mathfrak D_H$ and $\mathfrak R^H_G$ related to the discriminant and resultants of the conjugacy class involved. But eventually the exponent measures the codimension of the endoscopic stratum $\mathcal A_H$ in $\mathcal A_G$, which locally is relates to the dimension of the affine springer fibers, as you know.
This is mentioned in part by the report by J.F. Dat and D.T. Ngô in Lemme Fondamental pour les Algèbres de Lie, pp. 20-21, but I haven't been able to track this down precisely in B.C. Ngô's original paper.
EDIT: Looking more closely, I'm not so certain that my first paragraph is the right answer. But if you feel so inclined, I believe the key is Lemme 8.5.7 in Ngô, where he makes the local calculations (point counting) for some simpler cases. If that is the case, then there doesn't quite seem to be a geometric reason for the power of $q$, except that it matches the expected form.