What is the meaning of [good riddance to bad rubbish]

We are better off without worthless people or things; usually said on the departure of such a person or the loss of such a thing.