The general justifications for limiting free movement in TFEU article 45(3) are "public policy, public security or public health", and there is also a general exception in article 45(4) for "employment in the public service".
[