Most people don't start writing Real Sites hosted at a Real Host. They start with a stupid little static home page as a hobby hosted for free by their ISP or a $2-3 a month hosting provider. Then they want to add just one dynamic feature (maybe include a header and footer for each page), and they're obviously not going to learn Python and work out what the hell a WSGI is and get a new, probably more expensive, hosting provider just for that, so they use PHP, because it's trivial and already included. Then they need another slightly larger, feature. Fortunately there exists an Open Source php project providing just that feature, so they drop it in and it kind of just works.
A few more features get added in this way over the next few month and years and all of a sudden the sites popularity explodes. Now they have a whole bunch of stuff to deal with, and rewriting the entire site in some other language they know nothing about is not on the top of their priority list.