Dementia can be caused by brain diseases such as Alzheimer's or Huntington's disease, or by conditions that affect the brain indirectly, such as clogged blood vessels leading to stroke, certain vitamin deficiencies (such as B12 deficiency), thyroid disorders, pituitary disease, HIV infection, or syphilis.