Yes, Heine was married. In 1841, he wed Elise Krinitz, also known as Mathilde. She accompanied him into exile in Paris during the Revolutions of 1848 and was a constant source of support until her death in 1856.
Heinrich Heine: A Journey Through the Works of a Literary Icon