Whatever you think of him, AA Gill made a good point whilst discussing this very issue in yesterday's Sunday Times. He pointed out that sitcoms about the working-class are only truly funny when they're about the aspirational working-class, i.e. those that are trying to escape their class. The Trotter family trying to get out of Peckham by getting rich; Harold trying to escape from the Oil Drum Lane (and his coarse father) by aspiring to wealth and the cultured life; Bob (with the awful Thelma) trying to become middle-class, but being held back by Terry... even in Til Death Us Do Part it's only Alf who's truly proud of his working-class status, with his daughter trying to escape it and his wife more-than-hinting that she doesn't see what's so great about being salt-of-the-earth. It's true that great working-class comedy tends to involve characters who are, to a greater or lesser extent, trying to become middle-class. A lot of the comedy comes from them being held back by others (and by themselves).
Sitcoms which tend to celebrate working-class people proud of their class are mostly not as funny, tending as they do to reinforce stereotypes in their praise of working-class values, e.g. Scousers in Bread, or Essex girls in Birds Of A Feather.
The secret of great working-class comedy seems to be employ characters trying to get away from being working-class, rather than those who celebrate it.