The practice of giving criminals lighter sentences because of poor conditions in Western Australia's jails should stop in most cases, the state's Court of Appeal rules.