It does have to be justified based on existing law and this is important. But often, existing law only talks about broad principles or is contradictory, and judges are expected to fill in the details. In the case of the U.S. Constitution, these "details" can be really huge gaps.