If he'd kept his mouth shut instead of constantly talking himself up for other jobs, I doubt anybody would have been too upset. Even today, he is on record saying that he'd rather have the Celtic job.
As someone else mentioned, there are 2 ways to leave. The McFadden/Porter way and the Pearson/McGhee way.
EDIT: In fact Porter is the example McGhee should have followed. Chris mentioned he was coming to the club to move his career forward, and then kept his head down and did a great job. When the opportunity to move came along, he said all the right things, respected the fans and the board, and left with everybody's thanks.
That was the classy way to do business.