That’s Hanlon’s Razor, Heinlein’s is, “Never attribute to malice that which is adequately explained by stupidity, but don’t rule out malice.”
In both an element people often overlook is the keyword adequately. Sure anything can be attributed to stupidity, but in many cases it’s too beneficial to the “stupid” party and/or too persistent to be adequately explained by something other than malice.