For all the people defending offensive stuff stuff by saying Japan is racially homogeneous and unaware of cultural etiquette, I have a question for you: have you ever lived in Japan or worked at a Japanese company?
I've lived in Japan for over a decade, and I've worked at a couple of large companies that, I guess, make a few games that are really popular here on GAF. I can tell you that working at a Japanese corporation is just like working at a corporation anywhere else in the world. Employees get training on how to deal with folks from different cultures, how to deal with people of different sexual orientations, how to deal with the opposite sex (sexual harassment training is a yearly thing at many companies, and is really, really annoying), and all the other stuff you often hear folks complaining about when they say that XYZ is too much PC rubbish and they hate the "waste of time" human interaction training.
Additionally, most companies in Japan realise that they're gonna be fucked if they don't become more global, so many are making a huge effort to hire highly skilled foreign people. HR departments are struggling, but working hard to make skilled foreign workers feel welcome in a work environment that is really hard for foreign people, especially those from the United States or western Europe, to get used to.
People in Japan aren't dumb and they aren't on some alien planet. They are tuned into the same global media and information that the rest of the world is. When you see something that's questionable or racist or whatever in a game, it is highly likely that someone, in some meeting somewhere, mentioned the fact that it'd offend a particular group of people. The decision maker(s) either :
A. Didn't care and decided to roll with it.
B. Decided that the primary market was Japan and that the opinion of the group being offended didn't matter.
C. Decided that the group offended is not in the target demographic so it doesn't matter if they're offended.
D. The company can use language and culture and "not knowing" as an excuse if there's any backlash.
E. Some other BS reason that basically equals giving no fucks about the group in question.
I personally have experienced all of these at least once, and B and D on MANY occasions. If you see something, and it seems wrong, it is a safe bet to assume that the perpetrators had similar thought but for whatever reason rolled with it anyway.