That's a bit inaccurate. Germany and nearly every other country that the United States has fought against or aided militarily is compelled to allow US military bases through long-standing treaties, ideology, or realpolitik. Japan's not unique in that regard.
And it's not the US keeping Japan...