There are a lot of things that are against the regulations in prison but not illegal and/or not illegal outside of prison. Example:  Having tobacco.   Nevertheless, the inmate who breaches a regulation is often treated more harshly than an actual lawbreaker.