Some state and local lockups are facing federal intervention due to problems ranging from filthy cells to violent abuse.