If the man vowed to his first wife to forsake all others, she did not release him from this vow, and he decided anyway to go ahead and marry a second woman, then he has sinned by breaking his vow.
However, he now does have a second wife. He must not sin further by divorcing her - two wrongs does not make a right. He must choose to stop sinning, not keep adding more sin trying to fix things by digging himself into an even deeper hole.
So he now has two wives, like it or not.
Same goes for the man who has one wife, with monogamous vows, then has a secret affair. He is now required by scripture to marry the second woman. He can't get out of this by saying "but I vowed to be monogamous". Sure he vowed that - but he's already broken that vow. He should have thought of that before he took his pants off. It's too late now, the vow has been broken and that cannot be changed. Now he has two women anyway and he's going to have to man up to the consequences.