Sometimes yes, sometimes no.
There are four main canons of judicial ethics in the U.S. which have some sub-points, which explain how judges should do their jobs:
A judge shall uphold and promote the independence, integrity, and
impartiality of the judiciary, and shall avoid impropriety and the
appearance of impropriety.
Compliance with the Law
Promoting Confidence in the Judiciary
Avoiding Abuse of the Prestige of Judicial Office
A judge shall perform the duties of judicial office impartially,
competently, and diligently.
Giving Precedence to the Duties of Judicial Office
Impartiality and Fairness
Bias, Prejudice, and Harassment
External Influences on Judicial Conduct
Competence, Diligence, and Cooperation
Ensuring the Right to Be Heard
Responsibility to Decide
Decorum, Demeanor, and Communication with Jurors
Ex Parte Communications
Judicial Statements on Pending and Impending Cases
Disability and Impairment
Responding to Judicial and Lawyer Misconduct
Cooperation with Disciplinary Authorities
A judge shall conduct the judge’s personal and extrajudicial
activities to minimize the risk of conflict with the obligations of
A judge or candidate for judicial office shall not engage in political
or campaign activity that is inconsistent with the independence,
integrity, or impartiality of the judiciary.
The duties of impartiality and independence may require a judge to ignore public opinion. But there are also circumstances in which public opinion is relevant, usually, in circumstances where a judge has significant discretion. Rules 1.1, 2.2, 2.3, and 2.4 often require a judge to ignore public opinion. Rules 1.2, 2.8, 2.9. 2.10, 2.11, and almost all of the rules under Canon 3 and Canon 4, often requires a judge to consider public opinion.
Judges aren't umpires. As a judge at a recent seminar in Kansas explained:
[A]t least for conscientious judges, legal questions have an ethical
dimension. The complexities, paradoxes and uncertain boundaries of
legal decisions make it impractical for judges to plainly follow the
law wherever it leads, he said.
“It is a bit more complicated than that,” Stegall said. “Mature common
sense people of all stripes really know this intuitively. I do find it
interesting, however, how uncomfortable it often makes us to admit as
He said judges could be left in a quandary when laws or court rules
lacked objective, measurable standards and required members of the
judiciary to fill in the blanks.
“That’s when the subjective experiences of judges at least threaten to
be brought forward in the decision of the court[.]"
In sentencing a criminal defendant in cases where the judge has discretion in making that decision.
In determining an appropriate amount of non-economic damages or punitive damages or damages to reputation following a trial to the court.
In determining the likelihood that an alleged trademark infringement will cause confusion to the public.
Determining if material is obscene in light of "prevailing community standards"
Determining if a punishment is cruel and unusual.
In determining if injunctive relief harms the public interest.
In determining if a name change harms the public interest.
In evaluating the norms and customs of a community when this is an element of a legal claim, e.g. concerning what constitutes "good faith" in circumstances when it is defined broadly, and in determining what constitutes information that a person has a duty in good conscience to disclosed in a fraudulent concealment case.
In weighing how serious it would be for a criminal defendant to be freed prior to trial when weighing how strict conditions of pretrial release should be.
When evaluating which rule of law should be selected in cases of first impression that are not squarely controlled by other precedents.
When evaluating if a failure to recuse from a case would create an "appearance of impropriety."
When evaluating if a criminal defendant can receive a fair trial in a particular court venue given public opinion and pretrial publicity that may be pervasive in a potential jury pool.
So, the question cannot be answered in the abstract. One needs to know more about the context of the particular issue presented to know when it is and is not appropriate for a judge to consider public opinion in making a ruling.
The structure of the judiciary also provides some implicit guidance. Most states judges are either elected or subject to non-retention based upon a popular vote, which is a powerful constitutional message to judges that they should not be entirely divorced from the public sentiment that their decisions lead to. Even appointed judges are frequently political appointees suggesting that those systems too, although to a lesser degree, acknowledge that some recognition of public opinion is unavoidable and often appropriate.
But there is consensus that judges are not pure politicians and should consider public opinion only in circumstances when it advances their mission and duty, and not when it interferes with their independence and integrity.