An out-of-control former council officer was locked up after conning taxpayers of more than £1 million for almost two decades without being caught.