The Brigadier's death as referenced in "The Wedding of River Song" was intended as a tribute to Nicholas Courtney, the man who had played the Brigadier from 1968 to 2008, and who died in 2011 during production of Series 6. The Brigadier's death was important to the Doctor because it took the death of his closest friend to get him to accept his own. And behind the scenes it would not be acceptable to recast the role, so this also served to finally retire the character.
If this question refers to the Brigadier being written out of the series as a companion, Moffat was still a child when that happened. The decision was made during production Tom Baker's first season (1975) to end the Doctor's affiliation with UNIT, so the Brigadier ceased to be a regular as of "Terror of the Zygons", though he made a few return appearances as late as 1989.