Move ends decades-old duty by sheriff’s office; critics say decision is political and endangers detainee care.