Why do old people in the icu go crazy?

Not just old people. Severe illness, sleep disturbances and sedative medications used in icu's can all contribute to delirium. It is a major dilemma for health care providers and research into the ideal sedative agents is ongoing.
Delirium. It is not just old people, although they are at higher risk. Patients with critical illness commonly have delirium, this is a brain malfunction which can range from confusion/agitation to coma. In the ICU there are multiple causes. These include toxins that can be present from impaired organ function in the ICU , (like kidney failure) , side effect of needed drugs, or consequence of infections.
Can happen. Especially people with dementia are prone to what is called ICU psychosis. These people are sick and confined to a small room with all the alarms around them with nurses coming in and out--- they become confused agitated in a totally unfamiliar surroundings.
Multiple factors . This is called ICU psychosis or is sometimes called sun downing. In the ICU patient are often very sick , combined with lack of sleep due to their condition and treatment result in the confusion that is seen in the icu. As patient recover and are transitioned to a regular room or home they usually will return to their baseline.