Madison here's my answer in a more elaborated way, i hope it's not as confused as before.
The purpose of law is to maintain the status quo even more in a capitalist society to keep the relations of power intact and protect private property, justice through the system is only possible in the boundaries of the system it will never change it, the judiciary is a tool of domination and its political. And its worse when the system is essentially corrupted, by the economical system it lives on, the justice is elitist, racist, homophobic, the slums of poor countries lives in a state of exception the state violates their right daily, like Giorgio Agamben said "the state of exception today is the norm", but if we live in permanent state of exception where the law is differently applied because of the nature of capitalism that sooner or later will increases inequality and corrupts the system, why we should fix the judiciary if the source of corruption is beyond that too?
Judiciary through history it was composed by the elite or the nobility, education is expensive there's an economical filter already in place to join the court, and that is a big factor why the system is racist and elitist, white people have more money proportionally than black people and can't afford education until the person can join the court. In some places the way to join the court is corrupted by status, families, money , if you have luck and is very smart you can defy this in some countries and maybe join it, but the education of the law schools is usually not critical of the system, like Paulo Freire said "when the education is not liberating the dream of the oppressed is to become the oppressor". People are not educated in law schools to criticize the system but mostly to work with it, and if it happens to have a good university that makes the student criticizes the judiciary, its usually limited in the judiciary and not in a more broader way to the capitalist society and system, and even if by some miracle there's a critical leftist judge the only possible thing is to treat the poor according the law, its still protecting capitalism, inequality, the relations of power etc. And why fix this tool to maintain capitalism as a socialist?
In Latin America is even worse, firstly because the inequality is way bigger, second due to imperialism, and third by dictatorships. Since i talked about inequality i will talk bout the second and third points. With the cold war United States installed in Latin America with the help of the right wing dictatorships on it by the fear of socialism, socialists got killed, tortured, exiled, imprisoned, the composition of the judiciary was one that the dictatorship approved. Years later with the end of the dictatorships the countries never had a judiciary reform, or solved the problem to join it, so since the judiciary in most countries in Latin America is done by judiciary itself in this case a judiciary that helped the dictatorship, most of the people that would enter the court would be the ones that have a similar ideology to the ones before, and even if it joins a leftist its still in the minority.
About the fight against corruption, capitalism is a system in itself corrupted, the inequality corrupts the system, even in social democracies where inequality is smaller it corrupts it, and as is part of capitalism it will always make inequality bigger and corrupts it even more, and even if you live in a Nordic country where justice might be "fair" there's a third world country that's explored and its not, while people cant move freely, money can and due to globalization, capitalism has no boundaries to it, but there's to people because it needs cheap labor to exploit in third world countries and to not be a "problem" in the first world and its citizens.
I have pointed out that there's no point for a socialist in a socialist perspective in the capitalist judiciary, but lets think then in a reformist point of view, how do we improve the system and we fight corruption in this corrupted system? You cannot, you have to fix, judiciary in a reform. Any attempt by a right wing judiciary, would result in defeat only for leftist and that was used through history.
In Brazil history i could point out with the dictator Getulio Vargas
in 1930, the Conservative President Jânio Quadros in 1961, the military dictatorship of 1964, right wing impeached president Collor in 1990, and recently with lava jato, Dilma impeachment and Lula imprisonment and election of Bolsonaro. And that's not counting the international uses of fight against corruption and all the fascists dictatorships, like Mussolini, Hitler, or even Lugo impeachment in Paraguay and others.
The right wing likes to frame and use the fight against corruption as the big problem of society, when the problem is the system in itself, as if we fight corruption Latin America will be a better equal place, it disseminates this idea that we must fight corruption against inequality and justice for all when in reality the fight against corruption will keep the inequality.
Continuing to today with the lava jato experience, Sergio Moro got his inspiration with the italian operation "Mani pulite" (clean hands), where they used the media and popular support to put pressure in the judiciary to condemn criminals of the Mafia. I don't have to point out that Sergio Moro had a political interest in all this, he's justice minister of Bolsonaro and the leaks by Glenn Greenwald confirmed the political bias. Moro used the same way the media to help him in this fight against the corruption (fight against the left), so here i will explain another point before continuing. Who owns the media? Its usually the elite itself and they have political interests to protect capitalism, this corrupt unequal system, and in Latin America most of the big media supported the right wing dictatorships, and in Brazil it was not different. The media and judiciary convinced lots of the population that left is corrupt, that corruption is the evil of society, so the left must get imprisoned. Latin America has a thing called Domino Effect, that happens, this is a CIA theory if a thing happens in one country it can happen in the one next to it, and that what happened with lava jato, it started to get used in other countries. Due to the historical and material reasons i pointed out about court in Latin America that's why it mostly get used by the right wing they have the judiciary power and the media.
So to conclude in some points:
1 - There's no point in a socialist to fight for a capitalist judiciary.
2 - If we must go for a reformist route, the first thing is judiciary reform and even media reform.
3 - Fight against corruption is a right wing instrument, used to keep the left in check, its not interesting to use this instrument if the left does not have the judiciary, a more interesting fight would be to destroy the capitalist judiciary, since its purpose is to maintain capitalism, and the structures of power that keep inequality.
4- The lava jato is a right wing project like most of the ones before in the "fight against corruption" (the left), if Peru happened a different result and i assume my ignorance about the country, it was not intended by who created and the elite.