It appears that an IQ test can be administered if it can be argued that a certain score is required to do the job, and the test is not simply a way to discriminate. It sounds like a court case waiting to happen though: how does one prove what score is required? Easier if your defense is "we never administered an IQ test, tour honor".
The reason everyone doesn't test IQ is that it's not very useful, not that it's legally risky.
People think it is because there's an subtext that everybody would hire straight off IQ scores if they could, which supports a (frankly gross) biological essentialist argument a lot of edgy nerds are fond of. But the whole argument is fractally mythological.
The whole point is to have a test that is correlated with IQ, and does not look like an IQ test in a legal way.
You want a lower level administrative job? You better have a degree so we know that you're not stupid. Now you get to pay off your loans with 20 bucks an hour.
The degree was just a fancy filter if could read and write. If they worked out, they would be eventually hired direct into less mindless tasks.
Not all of the contractors were worth retaining.