I don't know about japan, but there are good samaritan laws that protect stores if they decide to give away (expired) food to hungry people in the USA. Unfortunately most stores either don't know about it or somebody in charge refuses to out of spite.