The reason why companies make candidates jump through all of these hoops is... because most candidates are AWFUL. At one point I was interviewing 5 developer candidates a week, and 2/3rds could not write the 5 line pseudocode needed to answer this problem: "write a function that accepts an array of integers and finds the highest value in that array"... half couldn't do it at all, and of the people who did, a huge number had a bug that caused it to fail if all numbers in the array are negative.
So yes, in a world where most "programmers" can't do a task that is literally taught in the first week of the first programming class they ever took, companies will be very cautious.
That said, it doesn't take endless interviews and process and tests to discover who the bums are, it takes about 15 minutes to figure it out. Employers are just tired of wasting their time.
Another reason for this is D&I initiatives. Employers need to be able to show an objective standard for hiring and salaries, to show that the people who get the job are truly the best candidate, and that decisions are not being made for inappropriate (or illegal) reasons such as gender, race, nationality, sexual orientation, and so on. Having the tests in place allows a company to justify each and every hire, and allow candidates to stand on their own merits rather than a gut impression of an interviewer.
J.Ja