Not only what ech_93 said, but irrelevant material takes time to present, takes money to obtain and having it presented costs money. To ensure there is a fair trial, all aspects of an effective trial must be covered as well as ensuring a party has their rights seen to. That includes the aspect of a timely resolution - when irrelevant material is disregarded, the trial isn't dragged out more than it should and it costs the parties less money (in court costs, legal fees and even stationary).
Also, briefs, interrogatories, etc. all ensure that the parties can determine what is relevant and what is not, and as such present it in court. The paper trail and communication between both parties allows those to base a defence (or prosecution) around certain evidence that will be presented in court, thus determining what is relevant and what is not.