the nation as a whole." I am willing to wager that you cannot find a single justice of the SCOTUS who has ever uttered that sense of the court's duties. Perhaps you confused your thoughts with the phrase "Interpret the law and apply the facts thereto," that would be the duty of any court.
Courts sometimes interpret the law contrary to what our individual sense of justice might be or against our particular moral standards, but the law is the starting place, it is not something that the court must discover. The facts may need to be discovered but not the law.