It was a LONG time ago! If the USA continued not to be friends with everyone it had ever been at war with, it would have virtually no friends at all.
So they've diplomatically kissed and made up, Japan is no longer governed in the same way, and both sides recognise it's good for both to be friends again. Whoever was in charge of Japan 78 years and more ago is not there now, and it is widely recognised in Japan that how it behaved back then was a bad mistake.
Or even if they weren't friends, it might be expedient to welcome the President as a guest and have talks. It's called diplomacy. Maybe someone could teach Trump about it sometime - general opinion of him around the world is that he looks and acts like an idiot, but nevertheless he will be welcomed because he IS the President and it's the diplomatic thing to do.
If a country does something the USA really wants to express disapproval of, one of the ultimate things it can do (short of going to war) is break off diplomatic relations. But then the two countries can't officially talk to each other so you really don't want to do that and it never lasts for very long.