I don't see how such a thing might be illegal, but the current century never ceases to amaze me. In any case, it is just a (very popular) shell script that downloads a few publicly available files and runs them in a controlled environment. It does not harm anybody.
Is it? Anyhow, it does not mean that it is illegal, which was the original question. I guess most ToS are not enforceable in practice. The worst that may happen is that you "lose the warranty" of your macOS install and you cannot ask Apple for support. No big deal.
Just because software is made available using a public web server does not mean that you are free to use it as you please. It's distributed along with a ToS agreement that governs its use.
Bringing in words like "illegal" can be fraught because I don't think we've seen a court case (in the US at least) about exactly how binding a "click-wrap" agreement actually is, but there's no question that projects like the one linked upthread violate the terms of the software license.