The hashrate estimation is noisy. It requires a lot of smoothing.
A sliding window like you suggest would work too, but it has the same problem: short high spikes in hashrate cause the difficulty to rise then persist through the rest of the 2016-block window, making the net blockrate come out about the same in the end.
So it would work, but it wouldn't have much advantage, and the hashrate is stable enough that there's not much incentive to fool with something that works.
Isn't the current system also affected by the short high spikes? Since the difficulty is calculated on time spent finding the blocks, a short burst of activity finding blocks also affects the difficulty, but then it's locked in for the next two weeks. Would the sliding window smooth out those sorts of oddities as well? Making the window too small (such as every block) wouldn't work, as you wouldn't have enough data to calculate anything from. I'm not suggesting that we change things, since I've enjoyed how it's working, but a friend and I were wondering about this earlier today and I have not read any answer to it before.