Immigration is a sensitive issue everywhere and especially in Japan, where many citizens fear foreigners will bring crime and disorder. So why did Prime Minister Shinzo Abe, a nationalist, right-of-center leader, decide last week to admit 500,000 blue-collar guest workers by 2025?

In a word, demographics. Japan’s persistently low fertility rate, 1.43 last year, caused the work force to shrink by 13% since 2000. Companies are screaming for workers, with an average of 1.59 jobs available for each applicant. The unemployment rate was 2.5% in April, the lowest among G-7 nations.

The labor shortage is one reason Mr. Abe’s program of economic reform hasn’t revived animal spirits, with GDP contracting 0.2% in the first quarter. The lack of hotel staff is holding back a boom in tourism. The average age of the Japanese farmer is 67. The lack of workers is hampering construction projects for the Tokyo Olympics in 2020.

Mr. Abe’s plan will grant visas to workers in hotels, construction, shipbuilding, farming and elder care. The latter need is especially acute given Japan’s aging population. Some 28% of Japanese are 65 or older, up from 24% in the past five years, and the government expects a shortfall of 380,000 nurses by 2025.

Many firms already employ foreigners on student or trainee visas. Visitors to Tokyo can practice their Chinese with the cashiers at convenience stores, while Vietnamese toil in factories, and restaurant waitresses hail from Nepal. The number of foreign workers in Japan has nearly doubled over the past five years to 1.3 million or 2% of the workforce largely due to short-term visas. By comparison, 17% of U.S. workers are foreign-born.