.Net languages aren't immune to this either, particularly Windows.Forms and ASP.net. To write decent code in those, you basically have to fight the IDE and the framework every step of the way. ASP.net MVC makes it much easier to write good code, at the cost of being harder to user if you don't already know what to do. Your average newbie can't just point and click until he's half way there.
PHP has decent frameworks, like Symfony. They make it much easier to do the right thing, and harder to do the wrong thing, at the cost of being more difficult to learn.
Props to the Symfony team though. They're still trying to make something good out of PHP long after most other decent developers abandoned the platform on favour of something less newbie-driven. It helps a lot to have that kind of framework available, just in case I have to use PHP for something.
Edit: Accidentally said that ASP.Net MVC encouraged bad code, but meant it encouraged good code.