Vinny was a new lawyer and had no courtroom experience. This was a huge case for the small town county court that doesn't likely see a lot of murder cases.
The judge quizzed Vinny on his trial history to confirm that he was experienced enough to take the case, particularly as he had passed the bar in a different state. Remember, Vinny is from New York and the trial is being held in Alabama. Legally, he can't practice law in Alabama, as he's only passed the bar in New York.
There are rules in place that allow someone to practice law outside their state for special reasons, these are generally set on a per-state basis. I don't know what the law in Alabama is and it doesn't actually matter... what the film seems to claim is that if the judge approves the lawyer, they're allowed to try the case.
So, Vinny has to convince the judge that he's experienced enough so that he can be allowed to take the defense... he decides that the best way to do that is to lie. If he'd told the judge that he'd never gone to trial before, that he'd only passed the bar on his sixth attempt and that he'd just been practicing for six weeks (as a personal injury attorney, at that), the judge would have laughed him out of the court room and the movie would have ended there.
There's another possible reason why Judge Haller needs to be sure that Vinny's good enough for the role... if someone is convicted and then they can later show an incompetency on the part of the defense attorney, the verdict can be overturned so that they have to start the entire trial process over again. This is called "Ineffective assistance of counsel".
Ineffective assistance of counsel is a claim raised by a convicted criminal defendant that their attorney's performance was so ineffective that it deprived them of the constitutional right guaranteed by the Assistance of Counsel Clause of the Sixth Amendment to the United States Constitution. Having the benefit of counsel or assistance of counsel means that the criminal defendant has had a competent attorney representing them. Competence is defined as reasonable professional assistance and is defined in part by prevailing professional norms and standards. In order to prevail on a claim that he received ineffective assistance, a criminal defendant must show two things:
Deficient performance by counsel.
Resulting prejudice, in that but for the deficient performance, the result of the proceeding would have differed.
With zero trial experience, it would have been very likely that Bill and Stan could later claim that he was incompetent to serve as their lawyer and I'm pretty sure that Judge Haller doesn't want that to happen.