I'll name a list of situations I can think off the top of my head, I'm sure I'm missing a lot of important ones.
HIV-already mentioned
Herpes encephalitis or any encephalitis for that matter, can cause psychiatric symptoms
Hepatitis C-correlated with a lot of psyche disorders but the cure-interferon is associated with a lot of psyche problems. Emory as far as I know is the head institution studying the psychiatric effects of interferon
PANDAS--OCD sx being caused by Streptococcus
Lyme Disease-can cause chronic fatigue syndrome, and a whole host of psyche sx
Syphillis if it gets to the point where it spreads to the brain can cause of lot of psyche problems. A reason why several places demand psychiatrists do an RPR before admission of a patient
Delerium being caused by any infections, but usually UTIs in the elderly.
Skin infections with E.coli are sometimes a sign of factitious disorder, where the patient cut themself & infected themself with their own feces.
Several psyche meds can increase the risk of infection or make treating infection very difficult
E.g. Clozapine, Olanzapine & Mirtazapine all can lower white blood cell count. We all of course know of the warnings in Clozaril, and many of us know Mirtazapine can cause agranulocytosis, but its rare to the point where its often not tested. However, I've seen data from psychiatrists at Jefferson showing that Mirtazapine can lower WBC on a subclinical level. This needs to make a psychiatrist think twice about giving it to anyone in need of a strong immune system such as a cancer or HIV patient.
And if a patient is on a psyche med that lowers WBC, you need to consider several situations where the patient may have an infection but because of a dampened WBC count, they might not show the classic signs of an infection. E.g. an IM doctor at my psychiatric hospital who only sees psyche patients told me that she had a few patients who had an ear infection & were on Clozapine & never showed any inflammatory related sx with the ear infection because their neutrophil levels were lowered. She told me that if you got a patient on Clozapine, treatment for something like an ear infection could be delayed, causing irreparable damage before the person feels the symptoms to make it known to their psychiatrist that an ear infection may be an issue.