A review of thousands of corrections department records reveals a state discipline system that tilts heavily in favor of prison guards.