Because commits should be small and fast, and always work, like a save. If you’re running a multi second process during commit it’s going to get ripped out.
(Unlike most formatters which are instant, dotnet format takes at least half a minute, because it performs a build just to format your code.)