"Good" is pretty subjective, and "bawdy" is pretty vague.Humour is said to be a defence mechanism used when one's sense of propriety is challenged but it is not appropriate to respond with hostility. However there is another sense is which humour can be a defence mechanism, that is to say deflecting the identification with the misfortune of others. This may be particularly so when the others are those who would normally have power over one but are temporarily at least seen to be (if not actually) disempowered by some misfortune.
Engaging it consistently can be tricky. What some find funny others find offensive. This is not necessarily due to the artistic quality of the material (vide Lady Chatterly's lover).
To take an example that is not sexual or scatological, many folkies find "Fixing to die Rag" (Country Joe and the Fish) both politically piercing and humourous. But others will find it merely disrespectful both of authority and of the dead patriots.
If this can be generalised, the reception given to a song is not necessarily the measure of its quality - only its fit to the audience. It may however be acceptable to hypothesise that the breadth of audience that can find a bawdy song acceptable could be a parameter useable to help to measure its quality, but you would also need to take into account the nearness to the knuckle of the material. The Ballad of Eskimo Nell is frequently said to be good poetry - but it would be rare for it to be thought of as acceptably humourous rather than generally offensive.
We have a long way to go to crack this puzzle!