Involuntarily committed residents of institutions for the mentally ill and retarded have a right to adequate conditions and treatment, a federal court has ruled. Institutions must take effective steps to habilitate such residents, not just keep them confined.