You could have always asked her to explain it and answer your question instead of assuming it's dirty and full of lice, I asked my best friend (who's black and regularly wears weaves) the same question a few years ago and she explained it to me, I never jumped to the conclusion you did. Theres no excuse for being ignorant.
You shouldn't have made the joke then, or go about whispering about it, just keep your mouth shut about the issue or apologise to the girl.