Conceivably, you could run trials by having a judge (or panel of judges) bring forth the evidence they thought was important. Instead, many countries have a system where one party prevents “one side” of a case and another party presents the “other side”. How did this come about?
In the simplest sense, a separation of duties. If the judge was to be the sole decider of what is worth consideration then you have this individual functioning as an unquestioned king.
No single person is going to know every case, consider every angle, and have an inclination to pursue all points of view. Even the supreme court receives amicus briefs to guide a case.
An attorney has a duty to get the best possible outcome for their client, even if they disagree with what the client may have done. A single person judiciary could never have that position because they are effectively advocating both sides to themselves.
Just to glom onto this correct answer, the system OP describes is the ideal for prosecutors. It’s not supposed to be adversarial. The prosecutors are supposed to exercise their judgement and seek justice, not victory. Unfortunately, prosecutors are evaluated on conviction rates.