2001–02 was his first season back at Cappielow. However this ended in relegation from the Scottish Second Division. The next season was much better as Morton won the Scottish Third Division Championship. The joy of a winners medal was not as sweet as it should have been for MacGregor. The reason being that in the 5th from last game of the season he suffered a broken leg and was ruled out of the game for a year. MacGregor was Morton's longest serving player having played for the club for 11 years. During that period his dedication was rewarded by chairman Douglas Rae when he gave David a three-year contract extension (when he was out injured) in 2003. He established himself as a defender in the squad. He is first and foremost a centre-back but he, more often than not, played at left back for Jim McInally, even though he is predominantly right footed.