It is because you have a one estimate (XBar) of one parameter in the computation of the sample variance for a single set of data - so your degrees of freedom (df) would be N-1. More generally, for a sum of squares, the general rule is: df = N minus the # of parameter estimates. An example would be a regression model with one predictor. In this case you have two estimates (b_0, b_1) of two parameters (Beta_0, Beta_1) and thus, your df to compute the Mean Squares for Error would be SS(error) divided by N - 2.