In Rowling's notes, Professor McGonagall had a backstory involving her delaying her marriage to Elphinstone Urquart until her first love (who she felt unable to marry for political reasons) had been murdered, blaming herself for his death, then finally marrying Elphinstone Urquart only for him to also die three years later.
Unlike some characters (e.g. Hagrid, Dumbledore, Snape), McGonagall's backstory ultimately never made the final cut, but it seems that at the time Rowling thought it would come up.
Rowling eventually published her notes on McGonagall's backstory in a 2011 Pottermore essay.
Upon graduation from Hogwarts, Minerva returned to the manse to enjoy one last summer with her family before setting out for London, where she had been offered a position at the Ministry of Magic (Department of Magical Law Enforcement). These months were to prove some of the most difficult of Minerva’s life, for it was then, aged only eighteen, that she proved herself truly her mother’s daughter, by falling head-over-heels in love with a Muggle boy. It was the first and only time in Minerva McGonagall’s life that she might have been said to lose her head. Dougal McGregor was the handsome, clever and funny son of a local farmer. Though less beautiful than Isobel, Minerva was clever and witty. Dougal and Minerva shared a sense of humour, argued fiercely, and suspected mysterious depths in each other. Before either of them knew it, Dougal was on one knee in a ploughed field, proposing, and Minerva was accepting him.
She went home, intending to tell her parents of her engagement, yet found herself unable to do so. All that night she lay awake, thinking about her future. Dougal did not know what she, Minerva, truly was, any more than her father had known the truth about Isobel before they had married. Minerva had witnessed at close quarters the kind of marriage she might have if she wed Dougal. It would be the end of all her ambitions; it would mean a wand locked away, and children taught to lie, perhaps even to their own father. She did not fool herself that Dougal McGregor would accompany her to London, while she went to work every day at the Ministry. He was looking forward to inheriting his father’s farm.
Early next morning, Minerva slipped from her parents’ house and went to tell Dougal that she had changed her mind, and could not marry him. Mindful of the fact that if she broke the International Statute of Secrecy she would lose the job at the Ministry for which she was giving him up, she could give him no good reason for her change of heart. She left him devastated, and set out for London three days later.
The school greeted Minerva McGonagall’s return with delight. Minerva threw herself into her work, proving herself a strict but inspirational teacher. If she kept letters from Dougal McGregor locked in a box under her bed, this was (she told herself firmly) better than keeping her wand locked there. Nevertheless, it was a shock to learn from the oblivious Isobel (in the middle of a chatty letter of local news) that Dougal had married the daughter of another farmer.
Albus Dumbledore discovered Minerva in tears in her classroom late that evening, and she confessed the whole story to him. Albus Dumbledore offered both comfort and wisdom, and told Minerva some of his own family history, previously unknown to her. The confidences exchanged that night between two intensely private and reserved characters were to form the basis of a lasting mutual esteem and friendship.
Like most of the magical community she suffered personal bereavements during the first period of Voldemort’s power. Among the worst were the loss of her brother, Robert; two of her favourite students, Lily Evans and James Potter; and Dougal McGregor, who was murdered, along with his wife and children, in a random anti-Muggle attack by the Death Eaters. This last news was a terrible blow to Minerva, who asked herself whether she might not have been able to save Dougal’s life had she married him.
Through all her early years at Hogwarts, Minerva McGonagall remained on terms of friendship with her old boss at the Ministry, Elphinstone Urquart. He came to visit her while on holiday to Scotland, and to her great surprise and embarrassment, proposed marriage in Madam Puddifoot’s teashop. Still in love with Dougal McGregor, Minerva turned him down.
Elphinstone, however, had never ceased to love her, nor to propose every now and then, even though she continued to refuse him. The death of Dougal McGregor, however, although traumatic, seemed to free Minerva. Shortly after Voldemort’s first defeat, Elphinstone, now white-haired, proposed again during a summertime stroll around the lake in the Hogwarts grounds. This time Minerva accepted. Elphinstone, now retired, was beside himself with joy, and purchased a small cottage in Hogsmeade for the pair of them, whence Minerva could travel easily to work every day.
The marriage (cut tragically short, though it was destined to be) was a very happy one. Though they had no children of their own, Minerva’s nieces and nephews (children of her brothers Malcolm and Robert) were frequent visitors to their home. This was a period of great fulfillment for Minerva.
The accidental death of Elphinstone from a Venomous Tentacula bite, three years into their marriage, was an enormous sorrow to all who knew the couple. Minerva could not bear to remain alone in their cottage, but packed her things after Elphinstone’s funeral and returned to her sparse stone-floored bedroom in Hogwarts Castle, accessible through a concealed door in the wall of her first-floor study. Always a very brave and private person, she poured all her energies into her work, and few people – excepting perhaps Albus Dumbledore – ever realised how much she suffered.
Pottermore: Professor McGonagall (some of the essay is behind a paywall)