They're investigating lots of crimes. Drug smuggling, for example -- they know it's happening, but they don't know who is doing it; and anyone entering the country could have useful information about it or be a potential suspect.
So would you be OK with the police randomly picking members of the public to investigate - just in case those people are doing something illegal somewhere?
They don't know that you're law-abiding, for one thing. Law enforcement agencies routinely record information which is volunteered to them.