It's important to understand that Justices of the Supreme Court are — for the most part — not merely judges, but highly educated and professional legal scholars. Like their equivalents in academia, Justices often have opinions and worldviews that are based on long analysis and dedicated philosophical investigation. They avoid appearing as though they are acting in a partisan manner because they want their opinions to be treated as the outcome of an informed and sophisticated reasoning process based on scholarly acumen. Their legacy as Justices depends on being viewed as scholars, not as partisan hacks.
It's worth remembering that Ruth Bader Ginsberg and Antonin Scalia were actually the best of friends, despite being almost diametrically opposed in their worldviews. They were friends on that level because their frequent disputes were carried out as stimulating intellectual debates, and never degraded to mere partisan infighting. The more obviously partisan Justices (e.g., Clarence Thomas, and I suspect Amy Coney Barrett, though she hasn't really shown her judicial chops yet), are generally less respected even among the partisans who support them, because they lack that capacity for detached intellectual argumentation that marks the real judicial stars.
All of the Supreme Court Justices recognize that there is politics played around judicial appointments and court cases. All of them recognize that the current climate in the US is highly polarized, and that political conservatives are writing a number of explicitly bad laws specifically designed to prompt court challenges, so that the supposedly 'stacked' conservative Supreme Court will overturn disliked ruling and standards. Most of them (I imagine) are currently worrying about how they can address these cases without destroying their legacy as Justices and making laughing stocks of themselves and the court. We'll have to see how it sorts itself out...