Hey Simon,
Out of sync sound is one of my pet peeves too. There are so many reasons for what you've mentioned that it would take a long time to cover each one fully.
The YouTube issue usually lies in the ripping software that a person uses prior to uploading their video. I have uploaded already synced videos to YouTube and they stayed in sync with no problem. But the ripping programs that are used sometimes don't keep the audio and video together. It's maddening to watch and with the proper program, very easy to "slip" the video back or forth to get sync.
Broadcast television is a different problem all together. The major cause of sync problems with television, whether it be commercials or shows, is the fact that the video and audio signals normally travel different paths through the whole system. Whether it's local or a network uplink that is then received locally, the video signal travels through a multitude of signal processors before it's sent back out, either by use of terrestrial towers or down the pipe of a cable system. Audio signals typically don't travel through a lot of processing so there can quickly develop a time lag in the video signal that is noticable to some people (my wife can't see it but I can see it even if it's only fractions of a second).
And if a signal experiences this "slow down" at several different places in it's path, then the difference is more noticable. For example, in November of 2007, PBS aired a 14 hour long series by Ken Burns called The War, focusing on World War II participants. The series was being sent live from PBS, rather than pre-sent to the stations, and the video was off by 8 frames or about a quarter of a second, according to PBS. I happened to be shooting in a large sound stage at a local PBS station all week and asked an inhouse guy about the delay. He rolled his eyes and said all the station's big wigs were up stairs on a nationwide conference call to try and find the cause and what to do about it. The second night was better but still not perfect. By the third night, it had been resolved and when the show was replayed off of tape or computer drives, the sync problem had been eliminated.
So what can a station do? Pay attention to what they air. It's not that difficult to put the audio signal through a processor, and set the delay to try and match the amount the video is being delayed. And they would have to monitor everything off the air, rather than the feed coming into their facility. But it just takes someone doing it and that involves people doing it and most stations would either say that they don't have enough people to constantly monitor every commercial and show, or they would simple say, hey, it's not our problem.
There are probably engineers here that can give you a more detailed explanation, but it's pretty much a processing issue with the video and audio signals where the sync problems occur. I've discussed this issue with different engineers I work with and they all say it's a problem that could be easily solved, if someone really cared about it. Apparently, not many in management seem to care.
Hope that helped.
rob
sound mixer/recordist