Currently, nearly 50% of Japanese adults are not sexually active. This has been reported in international news such as the Washington Post, the Telegraph, the Guardian, the Daily Mail, and Japan's own English-language news source, the Japan Times. Anime characters are a reflection of the real situation. Not all of the adults who are not currently sexually active are virgins: some are, while others are people who do not plan to become sexually active again.
Japan is a don't-ask,-don't-tell society: what you want to do in the privacy of your own bedroom (watch hentai, use body pillow dolls, any matter of fetishes, etc.) is not considered any big deal, and mentioning that you felt up a stranger's breast in a hostess club can be done in front of your colleagues without anyone raising an eyebrow, so it is not a "prudish" society at all. However, the Japanese overwhelmingly want you to keep your sexuality and sexual activities to yourself: do whatever you like and that will generally be respected, but PDA (public display of affection) or coming out and sharing about it to others is not socially respected (i.e. don't bother other people with it). Many young Japanese believe, likely as an influence from the Western nations, that it makes sense to test-drive a potential spouse before marrying (sleep together and/or live together), but it is simply the case that not as many Japanese are even dating and getting married.
Another cultural factor that may contribute, which you can see in quite a lot of manga and anime, is that a major format of Japanese romance is to like someone who you are not friends with for a long time, and finally "confess" your feelings in a sudden love letter, on St. Valentine's Day, or on graduation day, in which the recipient must abruptly decide whether or not he/she has romantic interest in the other person -- who might not have been on the recipient's radar whatsoever. This can result in either being turned down on the spot ("I don't even know you"), a willingness to try to go on a couple dates ("Maybe I could get interested in you"), or the first-choice being the recipient is overjoyed ("I secretly pined away for you for years too!"). A lot of romantic feelings and sexual desire are never confessed, but some that are get rejected due to the format in which the potential couple does not get to know each other through friendship or casual dating before a major DTR (defining the relationship) event takes place, or reciprocal feelings are confessed right after the graduation ceremony and the respective parties part ways to go to different schools for high school or university, so the mutual interest doesn't lead anywhere.
Ecchi content in anime is responding to a market that may not have an outlet for sexual release in a real-life relationship; on the flip side, characters who are virgins are easy for certain demographics to relate to, so if the virginal character ended up getting laid, the viewer wouldn't feel like a kindred spirit. In terms of storytelling, delaying steps toward the culmination of a relationship keeps viewers coming back for more episodes, such as rationing out the hand-holding, kissing, etc. (although this is perhaps not as often done regarding sex between characters in mainstream Western TV shows for adults, a good example is Sheldon and Amy in The Big Bang Theory). While delayed gratification is a normal plot device, in modern Japan, another type of love triangle has emerged in bishoujo harem and bishounen reverse harem anime: a lot of love interests are available to the protagonist, but he or she ends up not choosing between them and doesn't end up with anyone. This purportedly allows the view to favor any one of the potential suitors and imagine the post-episode happily-ever-after that they prefer without their favorite ship getting rejected in canon.
Legally, what is considered porn or not porn differs by country. I once turned on a Japanese TV during prime time (while kids are awake) and found myself looking at a topless woman in a live-action TV drama series. In manga and anime, non-pornographic depictions of nudity should not include the details of female nipples or any genitalia (and they usually do not include any body hair), so the bodies look Barbie doll-ish or the genital area is censored with a white spot (nothing is drawn there).
Not all nudity in manga and anime is considered sensual or sexual. Just as the Japanese public baths (onsen and sento) do not innately bear any association of nudity with sex among the general population, nudity can be included in illustrations that are not intending to have any sexual connotations. Historically, the Japanese were surprised by the foreigners who arrived on their shores and balked at the public baths, since the Japanese didn't view them as related to sexual interest. In fact, nudity can in some contexts connote purity, as in the final episode of Bishoujo Senshi Sailor Moon, in which the protagonist fights her final battle in the nude, her pure heart able to
reach and connect to the villain's and set her free from being possessed by evil.
Neither the villain, nor any of the onlooking supporting characters, particularly pay attention to her nudity during and after the battle; even when she is subsequently hugged by her boyfriend, there is no sensuality present in the depiction.