All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
The majority of Muslim scholars agreed to the fact that true Khalwah (privacy) between a man and a woman with whom he has concluded a marriage contract has its due implications such as entitling the wife to receive the entire dowry and to observe the due ‘Iddah and other effects. The word of the wife is what is considered in proving such Khalwah, and if she denied it while the husband admitted that Khalwah took place, then it is her say. The Hanbali scholar Al-Ruhaybaani elaborates: “If the husband said: ‘Khalwah has occurred before divorce; and accordingly I am entitled to revoke the divorce before the ‘Iddah ends,’ then his words do not count if the wife denied it; for it is her say. She is not entitled to receive financial maintenance or accommodation. As for the dowry, if she has not yet received it, she has the right to only half of it; because, even if it was agreed upon that she received it all, she can have only half of it if she denied the husband’s claim.”
This is the ruling on whose words would be taken into consideration in proving Khalwah, if the husband claimed it and the wife denied it, in general. As for your particular case that was brought to the court, you have no other option but to prove the Khalwah, or accept the judge’s verdict and the effective divorce that would be issued by the judge according to the available information. However, such divorce does not render what is impermissible allowable if it conflicts with what is implied in the Islamic ruling i.e. it is impermissible for that wife to marry another man while she is still married to her first husband.
Allaah Knows best.