Middleware lets a team add cross-cutting concerns — auth, logging, tracing, rate limiting — once, without touching every handler.
Cross-cutting concerns multiply endpoints and drift when implemented per handler. Middleware centralizes them: one auth middleware, one logger, one rate limiter, one tracing span. New endpoints inherit the behaviour for free, and a change to the middleware applies to every endpoint at once.