To start, you're not really going to see full-frontal nudity in anime. If you look at this question, you can read about censorship laws in Japan and about how--through self-censorship as much as through legal restrictions--genitalia and public hair aren't generally shown even in pornography.
There's a fairly vague rule called the Tokyo Metropolitan Ordinance Regarding the Healthy Development of Youths that is used to restrict access to "harmful material" to people under the age of 18. The relevant part is in a change called Bill 156 which was passed in 2010. From the Wikipedia article:
After the original bill's defeat, Tokyo governor Shintarō Ishihara announced his intent to submit a new revision later in the year. This revision, informally referred to as Bill 156, was submitted by the government in November 2010. It removed the controversial "non-existent youth" term but still proposed a number of significant changes to the law:
- The Metropolitan government is given the authority to propose controls on internet access for children of different ages, although it is required to consult with the telecommunications industry, parents' representatives and educators.
- The definition of harmful material is expanded to include "any manga, animation, or pictures (but not including real life pictures or footage) that features either sexual or pseudo sexual acts that would be illegal in real life, or sexual or pseudo sexual acts between close relatives whose marriage would be illegal, where such depictions and / or presentations unjustifiably glorify or exaggerate the activity."
- Any publisher who has more than six works declared harmful under the new criteria in a 12-month period can be referred to the relevant industry self-regulation body. If the publisher breaches the criteria again within the next six months, the Governor can publicly identify the offender and comment on the reasons for declaring their work in breach.
- The Metropolitan government is authorized to "encourage the establishment of an environment where child pornography could be eliminated and prevent its creation." The bill specifically mentions "any sexually arousing posing on the behalf of children under the age of 13 wholly or partially naked, or wearing swimwear or only underwear, published in books or featured in film," although as with its other provisions this only applies to drawings and animation, not to photography or film of real children. (Emphasis mine)
However, unlike in a number of other cultures, there is no particular religious or moral opposition to sexuality as a whole. From Wikipedia:
The gods and goddesses of Shinto are not repositories of morality or perfection; instead, they exist within nature and thus, sexuality is an innate part of life itself. Therefore, religious attitudes are no obstacle to the presence of pornographic material in Japan's secular society, nor is pornography blasphemous in any way, not even when it depicts religious persons (mostly shrine maidens) or mythological beings.
Nudity, sexual implications, and similar things tend to be used as fan service in anime. Debbi Gardner cites this as a cultural difference in comparison to places like America. While sexual or at least sexualized content may be considered inappropriate in the US--likely due to the much more puritanical Christian-based morality system--it isn't, at least not to the same degree in Japan.