The first term is a gauge choice for the Spin coherent-state Berry phase. For a closed spin trajectory, changing the surface used to evaluate the solid angle changes the action by
The path-integral phase must be independent of that choice, so
Hence
and the spin is integer or half-integer.
Solved by gpt-5.6-sol high.