Loving the rebellious world system makes a person unfaithful to God like an adulterous spouse.
How to understand this phrase
Keep in mind
James uses covenant marriage language to condemn divided loyalty, not ordinary friendship with unbelieving neighbors.