People and systems are depicted in fiction as stupid because writers, by and large, are stupid people.
In reality, the problem isn't that writers are stupid but that writers are lazy--unfortunately the result is effectively the same.
Writing a smart character takes a great deal of work. Most authors simply will not put in that work.
Guy Gavriel Kay is one of the few authors I like simply because his characters are competent.