The Anonymous guys on the other hand do it in their free time and as such have a far greater amount of time available to find bugs than the developers had to find&fix them.
On top of that most "hacks" by Anonymous are done using automated tools that find and exploit SQL Injection vulnerabilities. Combine that with that Anon doesn't publicize about the times they don't get in, it's easy to make it look like you know what you're doing. But if they find a SQLi vulnerability in 1 in every 10.000 websites they 'test' it's suddenly not that impressive any more.
They're not super smart, nor are the Sony developers/admins super incompetent. They're just average people making mistakes or taking advantage of others' mistakes.
Could Sony have done better? Yes, of course! They made some very stupid mistakes. Does that make the admins incompetent? Not necessarily. Nor do the holes in their systems make Anonymous super-smart.