The Espionage Act was enacted in 1917 (during WWI) aiming to block any interference with military operations or recruitment. According to this piece of legislation, any action which posed a "clear and present danger" would be considered a a criminal offense. The clear and present danger clause was therefore the condition that needed to be fulfilled in order to qualify as one of the very exceptional cases in which the rights provided by the First Amendment could be limited. The Sedition Act was enacted in 1918 and expanded the Espionage Act, including a broader variety of offenses.
The reason to defend these regulations would be that national security is the most important objective and therefore anybody which puts that at risk should be punished.
On other hand, detractors would state that placing limits on the basic civil rights, such as the freedom of speech contradicts the universal provision of those rights guaranteed by the US Constitution.