By never taking the credit and keeping a low profile, Penny and Brain are actually model special agents. The Robot Chicken parody shows how much danger they'd really be in if anyone figured it out.
In the pilot episode, Gadget is noticeably more competent and aware of the dangers around him, however he still screws up against Claw's robot, which Penny as usual secretly deals with herself. For almost all threats that Gadget thwarted before, he was escorting Penny and Brain at the time and thus aware they were in danger. This is consistent with most of Gadget's rare bouts of competence in later episodes, usually triggered whenever he realizes his niece is in danger.
Similarly he is escorting the two in "Haunted Castle" and returns to his pilot level of competence until they separate.
Penny and Gadget's differing aesthetic designs (Penny having a somewhat more real design whilst Gadget is cartoony like everyone else) are meant to show that their personalities and roles differ.
Gadget's varying degrees of competence and stupidity make more sense when you remember that he is part machine and that machines can sometimes malfunction.
Doctor Claw can be heard threatening several of his agents with the dire consequences of failure. It's only after the episode is aired that you realized those agents are never seen again...
Actually, we get to see the M.A.D. Agents arrested at the end of the episodes. The only ones that don't get arrested are the recurring M.A.D. Agents in season two, who copy Dr. Claw's tactic of escaping until next time.
In the pilot episode, Gadget was able to take care of himself, even if he wasn't particularly smart. After that, he becomes Too Dumb to Live, and practically needs Brain and his niece Penny to pretty much function, let alone foil Dr. Claw's schemes. Gadget is essentially a cyborg...and it may be very likely that the surgery that made him into one required an operation on his brain, and may have decreased his intelligence significantly! Also, the opening scenes show Gadget flying from a bomb and hitting his head hard. Could it be that the injuries he has suffered, particularly head injuries, have contributed to decreased intelligence on his part? Yikes!
It would explain why he gets dumber and dumber throughout the series, as the head injuries pile up....
What on earth happened to Gadget that he has those cybernetic parts? Did he volunteer for it? Did an obviously mentally incompetent person consent to it, or was it done to someone who once was mentally competent, and now is not? With all those things coming out of his hat, what was done with his brain? His limbs? Was he rebuilt like The Six Million Dollar Man? If so, how badly was this poor fool butchered? The guy doesn't even have organic legs anymore. Gadget is absolutely Blessed with Suck.
In the movie, he got it after going through a car wreck and an explosion. He was clearly very upset when he woke up to find that he had robotic limbs. But also consider, robotic arms and legs are understandable, but a toothpaste spray? A helicopter out of his head? Various implements in his fingers? How was that necessary? The idea of stuff like that being stuck inside a person when they're unconscious and unable to consent is creepy!
Dr. Claw's deep voice, his comment that Transylvania's atmosphere is good for his health, and the second season M.A.D. agent Thelma Botkin expressing disbelief at the idea that he had been a child does make one wonder if Dr. Claw is even human. If Claw is not human, then what could he be?
Dr. Claw had hidden cameras everywhere, including Gadget's living room. What was stopping him from installing hidden cameras in Penny's room?
When the Death Trap blows up in a MAD agent's face and they suffer the full brunt of it, they're never seriously hurt, just left a little bruised and/or sooty. So if that's all it does, how was it supposed to eliminate Gadget?
EMP bombs cause very little physical damage. If Gadget has electronics operating his gadgets, that's probably all Claw thinks he needs.
Penny's what - ten or twelve years old? And her uncle leaves her alone with the dog, at a moment's notice, to travel to exotic locations? Talk about neglectful! You know she's alone because if there was a babysitter/caretaker, they'd notice she was gone!
She's independent, responsible, and mature enough to handle it, and Gadget knows that. She acts like a miniature adult 90% of the time, it's not neglect.
She's still only ten. Just because she's smarter than him doesn't mean she doesn't need him.
He only plans to be gone for a couple of days. The age at which you can leave kids home alone for that long depends on their maturity, and Penny is very mature.
In the first film, "Robo-Gadget" sounds redundant but Gadget's a cyborg, and RoboGadget's an android.
In the second film, Gadget is shown to have a large house - but when he thinks of something while laying in bed, his neck extends, crashing into Penny's room, upstairs. It's a little odd in that big, nice house (two occupants and a dog), that Gadget would be sleeping on the first floor and Penny on the second - not to mention if his gadgets are that prone to crashing through walls and floors, why is Penny directly above him?
Ground floor master suites aren't all that unusual. Put an upstairs bath directly above the master bathroom, which is basic good design, and Penny's room being beside that bath and directly above her uncle's room makes perfect sense, as it gives her a corner room.
In the episode where Dr. Claw plans to trap Gadget by having crimes committed in a pattern of locations that spell "MAD" on a map, he views Gadget on his computer screen while he's INSIDE his house. This means Dr. Claw not only knows where Gadget lives but has surveillance inside the house.