Windows doesn't come with PHP, Python, or Ruby preinstalled, either.
In the age of CD-ROMs shipped with magazines, sure including a 'blessed' version of most programming languages made sense. Saved the average Linux geek from needing to hunt down a separate (physical!) package for PHP or whatever.
Now, the same reasoning applies to Linux as to MacOS. Unless the OS itself relies on them (Perl?), including some random version of various PLs makes as much sense as including a bunch of shareware games.
Removing general-purpose languages from operating systems makes a certain kind of sense, but it also pushes further in the direction of computers being devices for consumption, not creation.
Honestly I wouldn't mind if some distros ditched the "blessed" version altogether for non-system languages. I can't remember the last time I used the default PHP in CentOS, it's always grossly outdated. But distros like Debian have a policy of packaging any open-source program they can get their hands on and keeping them up to date, at least when it comes to security fixes. It's their choice if they want to provide that service to their users, and many users like it.
There's no need to have those versions pre-instaled though. As long as they can be installed with apt/yum then those who need them can install them.
But even for the non-critical software, packaged WP needs PHP, packaged Vagrant needs Ruby etc.
As for enterprise Linux, many customers relies on this packages, because they get reviewed and gets security patches on system updates.
But I guess MacOS is more of a frontend for Electron apps now so it's less important when the logic is to just bundle everything needed in 1GB+ executables.