Sir Tom Scholar's sacking compromises the civil service's independence, a former cabinet secretary says.