The story
Ultimately from such Latin poetic phrases as animae dīmidium meae (“half of my soul”) (Horace writing about Virgil), when it instead referred to a close friend (compare soulmate). First written instance of it meaning “spouse” was in 1580 by Sir Philip Sidney.
Etymology from Wiktionary, CC BY-SA 4.0.