The Supreme Court has ruled on several occasions that there are reasonable limits to the 4th amendment. In Illinois v. Lidster (2004) the Supreme Court ruled that police may set up a roadblock and ask drivers for identification and information during the investigation of a traffic accident. Par t of the rational for this was that asking for ID "interfered only minimally with liberty of the sort the Fourth Amendment seeks to protect" and "provided little reason for anxiety or alarm" to those stopped.
Much more relevant is United States v. Martinez-Fuerte (1976) in which the Supreme Court held that fixed checkpoints on public highways leading to and from Mexico were not a violation of the 4th amendment. This ruling was largely based on the Court's opinion that the intrusion was minor, and the public interest was great. While this ruling only applies to fixed checkpoints, the Court did specify that the probable cause bar was significantly lower for these searches, and that Mexican ancestry being a major factor in that cause was still Constitutional.
Delaware v. Prouse (1979) also allowed for discretionless checks for driver's licenses and registration.
The common theme in these cases was the balance between the intrusion and the public interest. This is an area I can provide a firsthand account. I spent a year as a student in Japan, mostly in the Kansai area. We were warned by the university that we needed to keep either our passports or our university ID cards on us at all time, as the police have the right to stop and ask for proof of immigration status. I was only stopped once, in a small town outside of Osaka, and can't think of anything other than my blond hair that could have aroused the officer's suspicion. I handed him my university ID, he examined and returned it, thanked me and we both went on with our lives. The whole incident was painless despite my very poor Japanese language skills, took less than 10 minutes, and didn't even cause me to miss my train.
I respected that Japan had a real problem with westerners living and working illegally in the country, and while as both a student and a worker there, it didn't bother me in the least to show that I had gone through the necessary steps to study and work legally. Moreover, common sense tells us that a basic request for ID is hardly an intrusion into privacy. Having gone through an arguably racially based check for immigration status, I can say it was much more pleasant that the average traffic stop. It was even less trouble then the last time I asked a cop for directions.
Besides, we've all been carded at a bar and it wasn't a big deal, was it?