People can write bad code in any language -- It just seems that alot of the people who write bad code prefer PHP; that's not to say there aren't some amazing PHP coders out there.
That leads to more inexperienced people landing at PHP and staying there.