Poor NHS care contributed to deaths of 13 people with learning disabilities.