He got sent off for... something. Probably a second bookable. He responded by yelling obscenities at the referee, who showed him a second red. As he stormed off he pulled a corner flag up - don't know if it was triangular - and hurled it away, earning himself another red card.
The SFA has a peculiar Penalty Point system for discipline. He effectively received 5 penalty points for one yellow card, 1 penalty point for the second (earning a red), 8 penalty points for a red card for "offensive, insulting or abusive language" and another 8 penalty points for the equivalent offence of abusing the corner flag - 22 penalty points in one game. I think he managed a nine game ban for that.