The head of the Metropolitan Black Police Association has been dismissed for gross misconduct over a chat with a former officer in which racist, sexist and inappropriate messages were sent and received.