State censorship in Japan has a fairly long history, but for the purposes of this subject has its roots in the Meiji government (1868-1912), when:
In 1882 the decision wa made to promote the development of an emperor cult by emphaizing morals in elementary education, and in 1887 the Press and Publication Regulations were written to systematize in the light of experience the various measures that had been taken on a more or less ad hoc basis until then. The subsequent passage of Diet-made censorhip laws in 1893 and 1909 did nothing substantially to alter the situation. The Censorship Division of the Home Ministry' Police Bureau remained the final arbiter of what could and could not be read, at least until the war years. The code empowered the police censors to strike without the inconvenience of having to get judicial machinery in motion and provided no route of appeal.
Basically, all books in Japan during the late-19th/early-20th century had to be submitted for approval, after publication but before distribution. This censorship was largely aimed at fiction and non-fiction, but also included the banning of nude artistic renderings (Rubin 43-45); going so far as:
[...] in the next Hakubakai show, the police ordered the exhibitors to cover the lower parts of nudes with maroon curtains. This was the notorious Koshimaki Jiken or Waistcloth Incident of 1901. In 1903 they went so far as to paste fig leaves on paintings and saw the penis off a male sculpture, even after have segregated the nudes into a special gallery.
The nominal reason for the censorship was to protect the morals of the Japanese people; and it is perhaps notable in the examples Rubin cites the art involved represents a European influence, especially naturalism, and notes "Writers, artists, and editors seeking to introduce Western aesthetic standards into Japan were faced with a deep-rooted cultural bias when it came to serious nude art." - this as opposed to pornography or casual illustration. In such a political climate with a strong nationalist government, writers and artists in favor of European-style naturalism in Japan faced off against the censors, and basically painted themselves (or were so depicted) as opponents to the standing political order. These conflicts, ideological as well as legal, led to further legislation:
[...] Article 175, the law against obscenity that has remained basically consistent since its inception during Japan's period of modernization. It's injunction against the realistic depiction of genitalia (including public hair) seems mysterious given that, under the same law, almost every other sexual or bodily depiction, including sadomasochism and analism, is permitted. [...] Critically, contemporary laws on obscenity originated during Japan's period of modernization with Article 175 of the Criminal Code in 1907 and Article 21 of the Customs Tariffs Law in 1910.
Allison argues that the first obscenity laws were not only there to protect Japanese eyes from "the graphic genitalia on western nudes[.]" but there to protect Japan's image to Western eyes; pornographic art from Japan had been making its way to Europe for decades, starting the Japonisme style in France, and as part of the Meiji modernization of Japan's military and industry it also wished to reform its image among Western nations.
Until 1991, the authorities monitoring obscenity had been rigid about certain conventions defining it. These were basically the realistic depiction of pubic hair and genitalia. The law itself i far vaguer on its definition of obscenity: that which produces a sense of shame in a "normal" Japanese person who encounters, in public, an image or text whose primary intention or effect is to simulate sexual desire. Legislators had adopted for year the public representation of pubic hair and genitalia as its standard for interpreting the law's notion of the obscene.
Post-Meiji Japan continued the basic censorship principles and practices given above, although artists and intellectuals continued to work against government censorship and sometimes find ways around it, but often self-censored themselves to continue publishing.
From 1945-1952 Japan was occupied by the United States military, and the influence of the US on the postwar political structure of Japan included an abolition of censorship laws and introduction of Freedom of Speech and the Press, although these were heavily caveated "freedoms" where American censors were put in place over Japanese publications through the Civil Censorship Department. In practice, American concepts of obscenity were no less harsh than Japanese sentiments, if not always exactly censoring the same thing for the same reason.
Post-occupation, censorship in Japan continues to be an ongoing struggle. Article 175 is still in effect, and the particular interpretation of it forbidding depiction of genitalia or pubic hair is familiar to many folks who have seen Japanese pornography. This has also had a couple of unexpected effects.
Pulp Demons: International Dimensions of the Post-War Comics Campaign by John A. Lent adds some details regarding to lolicon (depiction of underaged characters nude or in sexual situations), and in particular says:
Under Article 175 (or an interpretation of it applied to comics) of the Japanese constitution, "adult genitalia, public hair and sexual intercourse may not be graphically depicted, and certain slang words may not be written; children's genitalia and extremely 'cartoony' renderings are permissible, however." Although a few publishers of erotic comics were warned, and fewer still fined, most thrived throughout the 1970s and 80s, using various techniques (such as symbols and airbrushing) to stay a step ahead of pressure groups and the police.
Controls on manga broke down even further in the late 1980s, as the guidelines disappeared. Schodt felt that comics producers outdid one another in sexual provocativeness, at the same time they entered the mainstream magazines (even those designated for teenagers and younger children) and designed stories with a rorikon ("Lolita complex") flavor. "Instead of adult males doing very adult things to mature women ... the sex objects became increasingly 'cute'--and younger," according to Schodt.
Schodt being the author of Manga! Manga! The World of Japanese Comics. You might also want to see my answer on the origin of tentacle erotica in Japan.
Lent adds that a publicized murder of three pre-school girls in 1988-1989 by a "comic book addict" apparently spurred parental groups to action, and publishers started self-censoring...and there are other incidents cited by Allison that how the debate on censorship in Japan continues, with arguments ranging from freedom of expression on the one hand to the effect on public morals on the other.