The easy answer is because the plot of ace attorney isn't very serious, and the events happen because the plot demands they do, such as the law that dictates all trials must end in 3 days.
The hard answer (which is never explained but makes some semblance of sense and is my head cannon) is that Redd White controls the media, and has crafted the narrative that mediums are unreliable specifically to create blackmail material against the prosecutor and Misty. It is unknown if the general public believed that spirit mediums are unreliable before the Misty case, but you could construe that not really, and that White has manufactured public opinion in believing that it is.
As a side note, there are plenty of proven techniques that are not viewed as acceptable sources in court in real life too, however here it most likely is because the game doesn't want you to be frustrated that you couldn't simply solve all cases by going to a spirit medium.