The SCMP article does imply that the law serves both to try to keep a soldier’s mind on the job as well as some legal consequences for anybody specifically targeting a soldier’s spouse who is living alone during a deployment.
I kinda wonder if the law was created to be used in this particular way or if it was written broadly enough that it can be used in spiteful ways, as this instance seems to indicate. If you’re asked for a divorce by your spouse and the first thing you do is start checking security camera footage/cell phone records for evidence of infidelity, that says more about you than your spouse.
It’d be interesting to know the specifics of the law (which does not seem to be quoted anywhere in the article) and if there was any specific history behind its creation and application in court.