"The whole tooth" sounds like "the whole truth". A dentist is a type of professional that helps keep teeth healthy. Teeth is the plural of tooth. A tooth is an enamel coated structure located in the jaw of a mammal. The joke is replacing the word "truth" with "tooth" because they sound kind of similar, and it relates nicely to dentistry.
A dentist has to tell a patient the whole tooth .