In the US, individual judges have discretion over whether or not to allow the results of polygraph tests as evidence in a trial. The decision on whether or not to do so is guided by the Daubert standards and other relevant case law. The reason polygraph-test results are often not allowed as evidence in trial is that they are not entirely reliable. They can be fooled.
Yes, there is nuance to the statement that they are inadmissible. In truth, the largest opposition to the use of it in court comes from the legal professionals where their earning potential would be impacted by the use of it. Who pays for the studies that challenges the efficacy of the device?
...Even if Zone of Truth was not reliable, nearly any government in the typical D&D campaign that has access to it would use it. Just as most medieval governments used torture...
I think that is a broad statement and it misses a lot of nuance.
First, it assumes that a corrupt court/government wants truth. If you assume it results in reliable knowledge of truth, then it would limit their capability to extort and railroad.
Second, it assumes that the results would be trusted. Even if the cleric were beyond reproach, can the spell be beaten? There are spells and wizard abilities that can beat it by altering what a person believes. If an illusion of a person is in the aura, what happens if a decitful statement comes from that illusion? Well crafted statements can mislead while still being technically true. The spell explicitly allows that gap and we have a skill that makes it no more than a d20 roll away, even when a DM or player can't find the words themself. Few might have the resources to beat it, but some will.
Third, the organized criminal element might go to some lengths to keep it from being used...
Finally, what is or is not a lie is subjective. Who is the arbiter here? The speaker? The God? "Have you ever tried to cheat on your significant other?" Would it be a lie to say no if they flirted with someone else? Is it a lie if they kissed an ex? What if the ex got a bit handsy and the speaker stopped it... eventually. What if someone invited the speaker to a bedchamber and they went without really knowing what would happen, but they turned around and left when they reached the door? What if they got drunk and woke up in a strange bed with no memory of the night before? What if the speaker took an extra $200 from the bank in Monopoly while playing with their significant other? What if the speaker started a relationship with someone else and never told the significant other, but it took place between the first and second date with the now significant other? Heck, what is the view on solo adventures? I think you could get different answers from different judges on whether a "No" would be a lie in those various fact patterns. If the arbiter of the spell is not in alignment with the "judge", and that is known, what would that mean for the desire to allow the spell?
In the end, however, I think the question is actually whether the spell's use in a court makes for a good story. RPGs are role playing games, we play roles in stories, the game is good when the story is good. Does the spell make for a good story? Railroading PCs rarely results in fun for the players, so I'd think that it would be rare that the game would benefit for it to be used against them... although beating it can be fun once in a while.