This is how things work in Japan. If you are not a Japanese citizen then the police can ask to see your residence card to confirm your status.