I believe that is a consequence of macOS being built with BSD foundations. They're there. But let's not pretend macOS *nix/POSIX stuff is great; there's a reason that MacPorts exists.
I'd argue that Ubuntu does offer greater. Let's not pretend Xcode is a good IDE, either. I can't even recall the number of times I had my project crash on me.
And no, e.g. Ubuntu doesn't include Ruby or Git in default installation, nor FreeBSD.
Convenience to development should be measured by how easy it is to install/access development tools when you need them -- such as how well the package manager work, not how much stuff the base system come with.
Actually, I believe you can install Ruby/Git on Ubuntu install if you toggle Development tools. But anyone doing serious Ruby development will use rvm/docker.
Even when Ruby was included in Lion, nobody developing Ruby apps could use the vendor-supplied stuff. I remember this from back in 2008. There were countless blog articles telling you to download Ruby and compile. The situation from a decade ago caused a ton of pain in bootstrapping a developer setup.
Python? Preinstalled. Git? Got you covered. Ruby? Sits right there. Java? Check. Ant, Maven? You bet!
There is no other OS offering the same level of convenience to developers, no matter what stack they used.