The congress passed the espionage act due to the following reasons:
1. To prohibit having interference with the military operations, to ban the support of the U.S. enemies during war, and to promote the insubordination in the military.
2. It gave authority to the postal officials in the U.S. to prohibit mailing magazines and newspapers.
3. To make this law illegal to speak or write anything crucial of the involvement of America in the war.
4. It is a federal offense in order to use "profane, disloyal, abusive, or scurrilous language" about the government, Constitution, the US flag, and the American uniform.