Because it is neither "relatively small" nor, at least pre-industrialization, with limited natural resources.
Japan is one of the largest island nations in the world. It is in fact considerably larger than not only the UK but also the entire British Isles. And while the mountainous country does have considerably less arable land than the UK, it has more than countries like Egypt, Greece, Portugal, Ireland, Switzerland, all of the Nordic countries individually, and the two Koreas combined. If we posit that Japan does not have enough arable land to support a large enough population for an advanced civilization to develop, then that limitation should apply to all of the above, and many more. So we must accept that Japan indeed has enough land area and arable land to support a population size large enough for "advanced civilization" to develop.
Japan was also not in any way mineral poor. As /u/wotan_weevil explains, the internet parroting Japan's lack of iron, both quantity and quality, has no barring on reality. Japan also has plenty of other mineral resources such as copper, silver, and gold, and also sulfur, which they exported in large quantities in the early-modern period.
Geographically speaking, when compared to other places on earth there's nothing to suggest that an advanced civilization couldn't develop in Japan. Japan's natural resources by itself isn't enough to sustain an industrialized economy, but that applies to plenty of other advanced economies throughout the world.