We present a model of lawmaking by appellate courts in which judges influenced by policy preferences can distinguish precedents at some cost. We find a cost and a benefit of diversity of judicial views. Policy-motivated judges distort the law away from efficiency, but diversity of judicial views also fosters legal evolution and increases the law's precision. We call our central finding the Cardozo theorem: even when judges are motivated by personal agendas, legal evolution is, on average, beneficial because it washes out judicial biases and renders the law more precise. Our paper provides a theoretical foundation for the evolutionary adaptability of common law.