The technical was granted so by rule he must leave the playing area before the game can resume.
Technically I suppose the referee was correct in giving the coach his technical, but wasn't very practical about it and definetely not what I would have done.
The referee probably should have granted the technical first, then the timeout request if he was going to be all technical. Because calling things in that order it's like he's saying it's okay to call the timeout, so he grants it. But then he realized the coach wasn't supposed to stand, so he called the technical.
P.S. I see this is your first post. Welcome to the forum.