Shintoism has no fewer than four gods of male-male love, so no. Buddhist monks in Japan were also openly gay, like, all the time, so that’s not it, either. Confucianism bans gay marriage; I have no idea how relevant that is, here.
The Meiji era banned sodomy in 1872 in an effort to westernize. That would be my guess.