Programming is both technical and artistic. It's a creative endeavour that relies on technical skill to complete.
The best analogy to another profession would be to those in the 'technical arts', those like photography, joinery, painting, sculpture, drafting, perhaps writing too.
It seems at the moment that companies are approaching programmers as if they are purely technical like an actuary or bookkeeper and are seeking to quantify artistic skill through interview tests. This is rubbing off on some programmers who begin to think of themselves in these terms.
I don't recall a single instance as a photographer where I had to quantify my technical skill, but there were hundreds of times I had to based on my artistic skill, proving I had already made a vast range of photographs with sufficient quality to 'prove' my ability and by extension proving my technical ability.
Crucially, it was the fact I had a portfolio that allowed me to prove my ability, both artistically and technically.
I see a similar need in programming. I think programmers should create their portfolios of personal or paid for projects that showcase their technical and artistic skill and companies should take those seriously.
At the moment it seems that far to many programmers are attempting to get jobs without a 'portfolio' which is why, in an creative endeavour like programming, companies that hire are trying to quantify and determine a new hires ability with these seemingly bullshit tests.
There's room for improvement in this argument and there are outliers, but I think the basic premise is sound.