This article is a good overview, but essentially, gag orders are seen as a way to deal with an inherent conflict between the right to free speech and the right to a fair trial, and a judge's need to ensure a fair trial is seen as more important than a temporary restriction of free speech.