The court explained that the rule of law ensures that all actions by the state must be governed by legal principles, not discretionary decisions