While passing the judgement on Friday, family court judge Rajendra Kumar Sharma said that toilet at home was necessary for the family and going to defecate in the open was "disgraceful" for society and a "torture" to women.
The woman, in her 20s, "contended that her husband was cruel to her, there was no separate room for the couple in the house and no toilet".
Women in villages have to wait for dark to go out to relieve themselves and they have to bear physical pain, the court said.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.