# When is the action identically zero on-shell, and what does that mean?

The Dirac action is $\bar{\psi} (i \gamma^\mu \partial_\mu - m) \psi$, and the Dirac equation is $(i \gamma^\mu \partial_\mu - m) \psi = 0$. Then solutions of the equations of motion have exactly zero action. As another example, the harmonic oscillator has action proportional to the integral of $p^2 / 2m - kx^2/2$, and this also vanishes for any solution that makes an integer number of oscillations.

Of course, the value zero isn't that important, because you can always add a constant to the action. But you can't add a constant to just any action and have the solutions have zero action -- that feels like a very special property. Is there a criterion for when systems have this property? Is there any deeper significance to it?

I don't think there's any deep significance. For any free field theory (including the Dirac equation) the Lagrangian density is quadratic in the fields (up to a constant which there's no reason not to set to zero) and can be written as $\mathcal{L} = \varphi_i\, D_{ij}\, \varphi_j$ for some linear differential operator $D_{ij}$, so the equation of motion will take the schematic form $D_{ij} \varphi_j = 0$, and the Lagrangian density will vanish on-shell. As soon as you add interactions, this won't work anymore because the relative weights of the different terms will change when you differentiate and the Lagrangian density will no longer be proportional to the Euler-Lagrange expression.
Regarding the simple harmonic oscillator, there's no particularly good physical reason to only consider motion over an integer (actually half-integer) number of oscillations. The SHO has lots of sinusoidal dynamic quantities, so it's pretty clear that the action must be as well, and it's not surprising that it passes through 0 every half-integer number of oscillations. (BTW, the kinetic term of the Lagrangian for the SHO isn't $p^2/(2m)$, it's $(1/2) m \dot{q}^2$. The two quantities are physically equal but conceptually very different. Lagrangians have generalized velocities and Hamiltonians have generalized momenta.)