They are in hiring business not CS education business. Their business is not helping people learn things, but helping companies hire people.
If the solutions are available online, anybody can memorize them and ace tests, And they often do. If too many people do it, the whole point of test is defeated. The more solutions are available online, the more pointless the test becomes. Which actually says more about the testing methods themselves.
On the other hand, it's realistically impossible to keeping coming up with questions that can genuinely test a person's ability to come up with a novel algorithm for a problem. That's a CS PhD at least, if not a Fields medal category problem.