Hair is just a keratin process, like nails - they're for protection and warmth. They're constantly growing and being replaced.
Teeth on the other hand (well not literally), are not regularly replaced and do not repair themselves to a great extent. They are also more functional - we need them for speech and chewing.
Because teeth are exposed to whatever we put in our mouths, there needs to be a mechanism to tell us when anything goes wrong, like if there's excessive heat, cold or acid; or infection. Much as it hurts to get a toothache, your body is letting you know when infection has progressed to the root of the tooth and lets you take action. Otherwise the infection would keep spreading and could make you even more ill.