This is presented as a weeding out technique but it is actually a negotiation step. This allows the employer to establish precedent that you work off hours from home. This allows the employer to identify candidates that are willing to do whatever it takes for the job. These are the same people that won't do hardball negotiations for salary, employment terms or working conditions. Rather than weeding out the people who will fail the test, it weeds out the people who understand that asking for homework is unreasonable.
My last two phone interviews ended with the recruiter / hiring manager explaining that the next step was a take home assignement or test. I said OK, but haven't done either one. Next time I will politely tell them that they can look at code samples in my gthub but I am not spending my time jumping through their hoops just for the chance to have an in person interview.
It's bad enough that we have to burn an entire day to do an in person interview...there shouldn't also be homework.