Behind California prison walls, greed trumps security because of an unlikely villain: the prison guards’ union.