While in a class on the history of the Reformation, I learned that standing tradition among Catholics and Protestants was to punish adultery with whipping and exile, and in some cases, even death. This was for both men and women--in Geneva a man was executed for committing adultery with 20 or so women.
Now, so far as I know, adultery these days is a purely domestic matter that the civil authorities do not concern themselves with. Divorces, of course, are heavily legislated, and pre-nuptial agreements can carry penalties for those that have them. But the law seems to take a hands-off approach to adultery as such.
When did this transition happen, and why?
Which country are you talking about, and when? In Australia the Family Law Act of 1975 changed the law regarding divorce such that any and all divorces were covered by the term "irretrievable breakdown of marriage", and therefore no defining cause of break-down is covered under the act. Every country has different implementations.
After the introduction of no-fault divorces, I think you'll find that 'adultery' under these circumstances becomes a contractual and therefore civil matter and is not covered in the criminal code. But I think that would be more of a law and not history question, and definitely specific to each country.