The whole point is for the other side not to like it and get knocked emotionally off-kilter and lose focus, giving you a competitive edge. It's part of the metagame.
It is also generally considered unsportsmanlike and in most cases does not contribute to the game or sport. It reduces the competition from, "Who is best at game strategy and mechanics?", to "Who is best at heckling away any real advantage their opponent actually had?"
For most online games I don't see how the latter could ever be considered an improvement to the game.
People have trash talked their way to millions of dollars in poker tournaments.[0]
You can "regulate" this away as a tournament organizer/gamedev company if you wanted to (i.e. allowing allied team only chat or allowing players to disable chat visibility altogether)
Trash talk has a long history: https://en.wikipedia.org/wiki/Trash-talk
The whole point is for the other side not to like it and get knocked emotionally off-kilter and lose focus, giving you a competitive edge. It's part of the metagame.