It is obsolete tradition but some like it.
Redirecting to single domain rather than using multiple identical mirrors is a good practice for many reasons.
Nowadays it usually is just example.com however sometime long ago web servers were usually located specifically at www subdomain and this was indication of WWW (HTTP) site available there. It is mostly gone now but some people still like it for some weird reason.
@yura It's generally preferable to have a single canonical domain for analytics and SEO purposes. My personal preference is to do the inverse redirect (www => root), this is usually the more modern approach
The www subdomain exists mainly from a historical time before http became established as the dominant form of internet traffic, representing the web segment of a more multi-service domain https://serverfault.com/questions/1153285/is-it-better-to-redirect-root-to-www-or-www-to-root