Having worked in a place where we had access to just about everybody's income (which incidentally is one of the reasons why civil servants need to be paid better) it was actually a fireable offense if a person was caught looking up anybody for any reason other than what was necessary for work. But considering the sheer volume of people who were being looked up by the average employee in a day, you had fair odds of not being caught if you didn't otherwise attract attention and get them looking at you too closely.. However, if it ever became an issue, as in IF they ever decided to check and noticed that Eddie Vetter (actual incident) probably hadn't filed a claim for unemployment lately, or if there was a complaint about your bragging about and/or misusing your information access in any way, you were outta there (with no unemployment! ) I can see where this mother in law could very well be found out and terminated for gaining access to her ex son in law or daughter in law's medical records.
However I am confused as what would such information do that would benefit the custody case for one side or another? If the other party has a drug problem, that's going to come up anyhow, If they have a mental health issue, that's going to come out. I don't see quite how medical information could be obtained from these records that would not be something that was already known.