The 1st Amendment guarantees freedom of the press. Why would the Supreme Court allow the government to limit this freedom
The Supreme court has generally allowed the government to limit the freedom of speech for speech with a characteristics of obscenity, such as forbidden materials of illegal character. One way of determining whether something qualifies as obscene is the Hicklin test: a material is obscene if it could "corrupt" people.
the government may censor the press in the interest of national and military security