40 people died in ‘barbaric’ secure hospitals the government pledged would close