I'm not going to defend them, but they tend to tie in to visa status. You can be allowed to live in the country but not to actually work. For example, I'm in Japan as a student and can't work full time. If you come in as a tourist on a temporary visa then work is definitely not permitted. Further, categories of work tend to be restricted -- so if you're filling a place a native Japanese could not (eg computing or other engineering job, or translation or other job requiring a native English speaker) that's OK, but you can't just get a construction job, say.
So they exist for the same reason that visas exist at all -- government desire to restrict who comes into the country so that people who already live (and vote!) there aren't unduly burdened/inconvenienced/inflamed by the tabloids into thinking that their jobs are being abducted by aliens.
I'm less confused by the concept of telling people "you can come to our country for x months and not work" than "you can come and live in our country indefinitely, but you can't work until you've completed this additional arcane piece of process".
(Ignoring the case of "you can come and live in out country whilst you have a job with $CORP")
Apparently in the UK system the work permit is something given to the employer rather than the worker -- it's a thing from the government saying it's OK to appoint some random foreigner to a particular post. The worker can only get a suitable work visa if they've got a job lined up where there's been a work permit issued.
Also, if you have a permanent resident visa you can do any random job just like a citizen.
This seems reasonably sane, so perhaps it's just the US system that's confusing you?