James Ron, a former professor at Carleton University, has written an interesting piece on the situation faced by bureaucrats who personally object to the policies of the government of the day. It is an interesting read.
One major justification he leaves out is the view that while a particular policy might seem objectionable to the person thinking about it, they simultaneously see that policy as the product of a democratic system of decision-making that they endorse overall. I have written before on why this view is problematic, but it is nonetheless another way of squaring the circle Ron describes.