The officer can likely do this:1) Believe that he (i.e. the authorities) may possibly need you as a witness or get further information from, such as about what you observed while riding in the car. You were a witness to the infraction, and the police can gather contact information for witnesses. Checking your ID is the most certain way to confirm your address, etc.2) You were in an Uber. An Uber is not a cab; it is a private car. It is NOT as immediately obvious that you are a customer, not an associate, of the driver. The officer has only what you and the driver tell him in that regards--it's like you are in the backseat of a vehicle painted as a cab and belonging to a known cab company. Generally, the laws involving Uber are still evolving, but it is not clear yet to what degree they (and the people in them) are treated like cabs & customers, or instead like private cars and passengers.