Do you need insurance to travel to Japan?
As of today, Japan does not require travel insurance to enter as a tourist: it is not an entry requirement the way a passport is. Even so, the Japanese authorities have for years strongly recommended that all visitors travel insured. In fact, the Japanese government has floated making it mandatory, partly because of the problem of medical bills that some tourists leave unpaid; there is no confirmed official date, so it is worth checking the current situation before your trip.
Official channels in many countries (embassies and foreign offices) likewise advise travellers to hold private accident and illness cover that also includes repatriation costs. This is therefore not a commercial recommendation: it is what official sources advise too.
The fact that it is not mandatory does not mean it makes no difference whether you carry it. The underlying reason is financial: if you have a medical problem in Japan without coverage, the cost is entirely out of your pocket, and healthcare there is not cheap for a foreigner. That is why, for the vast majority of travellers, taking out travel insurance is one of those decisions you almost never regret.