A council has been prosecuted after the death of a vulnerable day visitor to one of its care centres.