I think it is a very bold and far out reached allegation to claim that the controls were not legal without knowing the whole background. Was it really a border control or was it for example a DEA check with the specific job to search for illegal substances.
In general ID controls are very seldom and the regular traveler will normally never encounter them but when entering the Schengen area. Still it can happen especially when large events like for example the European Soccer Championship is taking place or other large international events.