Japan is considered quite a clean country; germs are not welcome anywhere. You will see that surgical face masks are often worn around train stations and parts of cities, either by citizens who are sick and do not want to spread their virus, or by citizens who do not want to catch anything.
It is for this reason that money is hardly ever directly handled. It is common for businesses and restaurants (especially fast food) to set out a small tray near a cash register so that customers can place their money on the tray. If they provide a tray, it is considered rude to ignore it and hold out the money for the cashier to take by hand.
Note: This tray is not for tips!
There are other broader reasons for not directly handling money; it means you can receive the item you have purchased with both hands. This shows you are respectful of the items you have received and are handling said item with care. This applies to also paying with a credit card.