I wonder if the name for Spain in Japanese is 西班牙 (west, group, tusk?) because it has some implicit meaning (like English expression as 'horn of Africa', 'strait of ...', Middle Kingdom, ) or it just happens that the sound of the kanji matched the Japanese version of Spain (スペイン).
Related answer on Chinese Language SE– ProgrammingLlamaJan 20, 2020 at 6:56
It’s just because the kanji 西班牙 sound like スペイン.
“The kanji are ateji (当て字), from Chinese 西班牙 (Xībānyá).”
3I don't believe this is entirely accurate. It seems to me that スペイン was applied to 西班牙 when the katakana "スペイン" became the popular way to refer to Spain. If you listen to the Mandarin pronunciation, it sounds similar to "España". Jan 20, 2020 at 5:35
1Yes, as @John points out, the spelling is older than the reading. The reading スペイン comes from English, and the English language didn't have any real influence on Japanese until after the Perry Expedition in 1852. Meanwhile, Portuguese speakers had been in Japan starting from 1543, and Spanish speakers from shortly thereafter. The name for "Spain" in Portuguese is Espanha, and in Spanish España, sounding basically the same in both languages, and not too far from the Chinese reading Xībānyá. Jan 21, 2020 at 17:23