Not sure whether it is due to SEO or for a security reason. But according to what I have found in an answer to a question here, it says:
Leave it as it is. Google will figure out the canonical url and keep them in their index.
Is there any good reason why Stackoverflow is actively redirecting permalink URLs and URLs with an old question title to the canonical URL? Why not just specify this canonical URL in the html link element since the slug is not part of a query input?