I think it does more harm than good.
Matching urls in code is just a little bit harder.
Servers are capible of running more than one port on an IP and usually different services don't conflict.
Add a subdomain if you need another service running on a different IP.
This practice make configuring things like wordpress, SEO, and cloudfare just a little more complicated.
Here's an idea. If someone contacts your server at the ip listed for that base domain on port 80.. just serve the page. We don't need to give the server any more clarification.
That matter is discussed for at least a decade now.
My current opinion is, that it's best to forward everything to https and www to non-www.