It goes back to the Founders, in my opinion. I believe they made a serious mistake establishing a Supreme Court. After that, they added to their mistake by granting life tenure.
Well for the first hundred years or so SCOTUS functioned against violations of the Constitution coming from the legislative or executive branch.
After that, especially starting with Roosevelt and accelerating in the 1950s, it itself became the source of unconstitutional actions.
Now it functions as a unelected super-legislature-for-life.