In the begining television comedies were just comedies, e.g. ‘Show of Shows.’
Then came sit-coms, e.g. ‘I Love Lucy.’ These shows never stressed a morality other than don’t embarass yourself. There was never a, “Well, Timmy” moment.
Now sit-coms have to be morality plays, e.g. A very special ‘Brandon’ that should be watched by the whole family. (‘Sienfeld’ was an exception which may suggest its popularity.)
When did sit-coms become morality plays? I think the earlest cite is ‘Happy Days’, a ‘Love American Style’ spin-off.
Just about every episode of Leave it to Beaver, if I recall correctly. Quite often, Theodore would find himself in some moral dilemma, such as his fear that telling the truth in some situation will lead to his peers’ “giving him the business”. Ward would sometimes give his son a gentle reproof for some moral lapse, usually sitting at Theodore’s bedside while still wearing a coat and tie. If Ward was ever to harsh in his rebrobation, however, June would tell him, “Ward, I think you were a little too hard on the Beaver last night”.
Every episdode of the Andy Griffith Show (early 60’s) had a moral. In fact, somewhere on the internet you’ll find a series of Sunday School lessons built around various episodes of the show.