The purpose of this study was to compare the prevalence of mental health conditions among patients undergoing (1) primary total knee arthroplasty (pTKA), (2) septic revision total knee arthroplasty (rTKA), and (3) aseptic revision total knee arthroplasty (TKA). The State Inpatient Databases were queried for all TKAs from 2005 to 2014 yielding 563,144 patients. Patients were separated into the following cohorts: primary, septic revision, and aseptic revision. Diagnoses of any mental health condition and the following specific conditions were compared between the three cohorts: schizophrenia/delusion, bipolar disorder, depression/mood disorder, personality disorder, anxiety/somatic/dissociative disorder, eating disorders, attention deficit hyperactivity disorder /conduct/impulse control, alcohol abuse, and drug abuse. Throughout the study period, an increase in the prevalence of mental health conditions was observed in septic and aseptic revision patients. Overall, there was a significantly higher prevalence of mental health conditions in the septic revision cohort (22.7%) compared with the primary (17.8%, p < 0.001) and aseptic revision (20.0%, p < 0.001) cohorts. Specifically, septic revision TKA patients had a higher prevalence of depression (p < 0.001), alcohol abuse (p < 0.001), drug abuse (p < 0.001), schizophrenia (p = 0.0007), and bipolar disorder (p < 0.001), compared with primary TKA patients. Additionally, there was a significantly higher prevalence of depression (p < 0.001), alcohol abuse (p < 0.001), and drug abuse (p < 0.001) among septic revision patients compared with aseptic revision patients. Mental health conditions were significantly higher among septic revision patients. Alcohol and drug abuse were approximately twice as prevalent in septic revision patients compared with primary and aseptic revision patients. These findings should serve as a call to action for mental health support for patients suffering from PJI.