The concept of the hieros gamos is a ubiquitous archetype found in every tradition rooted in the Perennial Philosophy.
If this "marriage” symbolizes a proper union of previously separated elements, then it follows that the opposite situation: mismatched entities, symbolized by adultery.
To recreate a primordial gestalt of perfection out of an exploded multiverse of mixed forces demands the original pairs of opposites become properly matched correlates.
Although any two opposite genders might feel a mutual attraction, there is really only one opposite which is an appropriate spouse.
In the realm of human relationships this is evoked in the concept of the Soul Mate.
Esoterically speaking, every polarized force in the multiverse has its proper correlate; it follows that the largest conception cannot be completed until each is reunited with other.
Indeed every act of sexual intercourse which has occurred between those unlike one another is adultery.
Members of a race usually have associated with those of like race. So spirit mingles with spirit, and thought consorts with thought and light shares with light.
If you are born a human being, it's the human being who will love you. If you become a spirit, the spirit will be joined to you.
If you become thought, it is thought which will mingle with you. If you become light, the light will share with you.
The Gnostic Gospel of Philip.