It's entirely logical and they are definitely connected.
Adultery is one of, if not the most common motive for murder.
Adultery is also a major reason why people get divorced.
Divorce breeds all sorts of ill effects on society. Not the least of which is teen pregnancy, teen suicide, drug use, abortion, sexually transmitted diseases, etc.
Growing up without a father in the household is the number one indicator as to whether a boy will end up in prison (for whatever reason).
There are virtually no gang members whose father and mother are in the home.
This, of course, is not to say that if you criminalize adultery that there won't be any more gangs or drug use or murder. The point is simply that it has an enormous effect on the whole of society. It effects way more than the people directly involved in the broken relationship. It effects everyone. The ripple effects are seemingly endless!
One single just law transforms an entire society! God is indeed just, righteous and merciful in all His law!
Resting in Him,
Clete
Thank God you're not in charge of anything to do with the laws of the land. There would be "wholesale slaughter" everywhere.