The point of the judiciary branch is to enforce the constitution and the law, basically, yes? So, I think it's pretty obvious that the constitution and the law do not have a transcendent meaning that is outside or above history. What this means in practice is that, basically, in the event of disputes about what the constitution and the law mean, the answer is that the interpretation of the majority of citizens should ultimately prevail.
I mean, @AmazonQueen says you need the judiciary to be insulated from popular will because sometimes you need someone to unpopularly affirm the rights of the accused or otherwise stand up for genuinely oppressed minorities.
I don't disagree with that, exactly, but in the US right now we have a judiciary insulated from popular will not only in the sense that a magistrate who can lose the popular vote but still win office appoints them for life, but that all of them are drawn from an elite group that moves through a set of elite institutions (private schools, elite universities, elite clerkships, etc) that deeply alienate them from the experiences of most Americans. And the result seems to be a Supreme Court that is stripping away people's rights left and right. You have the Dobbs decision of course, but then also the Vega v Tekoh decision which is the latest in a long line of cases dating back to the Reagan administration where right-wing federal courts and the Supreme Court have generally eroded the ability of citizens to seek civil relief from police misconduct while at the same time making it more difficult to hold police officers accountable for misconduct using administrative and criminal law.
Most Americans are broadly in favor of police reform, abortion rights, gay marriage etc. so I see a court insulated from popular opinion exploiting that insulation to carry out a right-wing agenda that would never succeed if carried through the federal offices that actually are elected. In any case, far fewer people would feel their rights in danger right now if, across the board, the US government were more responsive to popular will.
Anyway, the role of the judiciary doesn't change in my proposal, it's just that I much more directly subject the judiciary to popular will and ensure that the popular interpretation of the Constitution will prevail over interpretations that privilege elite interests.
That would suggest you need to extend the pool you're choosing your judges from, not that you need to elect them.
We began doing this with more female judges, more judges from ethnic minorities 30 odd years ago. They are much more diverse now than they were in the 70-80s.