From Wikipedia:
Also, among Edo-peroid middle class Japanese, there was the prostitution of male kabuki actors (onnogata) and male homosexuality appears to have been a big literature theme for a long peroid of time, although female homosexuality seems pretty much undocumented.From religious circles, same-sex love spread to the warrior class, where it was customary for a young samurai to apprentice to an older and more experienced man. The young samurai would be his lover for many years. The practice was known as shudo, the way of the young, and was held in high esteem by the warrior class.
From what I understand from talking to friends (not always the greatest source), homosexuals in Japan today are usually seen as merely 'adnormal'. Manga and anime have embraced homosexuality of both genders, usually for the entertainment of the opposite gender ('yaoi' and 'yuri').
Religion does not seem to condemn homosexuality in the peroid of history the article is refering to (roughly the Edo peroid, although assumingly up until attitudes changed). In fact it seems early Buddhism was the source of the trend, or at least popularised it. Shinto as far as I've read does not condemn homosexuality.
This issue is a lot deeper, but the Wikipedia article summed it up better than I am able to (search Homosexuality In Japan on Wikipedia).