Depression is a mental illness, and stems from abnormal chemistry of the brain.
Most rational people wouldn't criticize somebody for getting cancer. The same should go for depression.
It can be treated with medications, but sometimes the patient decides the side effects are worse than the depression, and stops taking their prescribed meds.
Treatment is not a perfect solution, making all the symptoms vanish.
It is NOT a disease which only afflicts people of low character, or low morals. It can stand alone, apart from drug and alcohol abuse, however some depressed patients self-medicate with drugs/alcohol.
Williams at one point had long term sobriety from drugs/alcohol but a few years ago he relapsed. It appears he has had difficulty getting back on track, ending with this sad situation.
My own youngest sister has severe depression, but so far has been treated with prescription meds. She has never drank or used any drugs, never.