Let's get a little more specific...
Most code sucks because the programmer:
- didn't name his variables what the really were
- didn't understand variable state
- didn't understand variable scope
- didn't understand the basic concepts of iteration
- didn't understand any of the algorithms he needed
- wrote the same lines of code multiple times
- didn't know enough about the language to find a better construct
- didn't understand concurrency
- didn't understand fundamental data base concepts
- refused to follow well worn standards
- didn't have any well worn standards to follow
- built code on top of hopelessly designed data structures
- didn't understand deeply enough what was going on under the hood
- built to requirements that changed too dramatically to recover from
- didn't even consider the concerns of the "next" programmer
But most of all: - was just good enough to get "something" (no matter how bad) deployed on time