That seems like it should be completely illegal. Not that it necessarily registers in the long list of terrible things Uber has done – however, it does have the feature that it is poor/illegal treatment of their customers apparently explicitly ordered by Uber, so their non-defense of “we aren’t responsible for what our independent contractors do” can’t be applied.
Also, seems dumb. If I were an undercover cop investigating Uber, and halfway through the ride, skynet decided I wasn’t wanted and the driver stopped the car and tried to kick me out and strand me on a freeway offramp, I can say that I would do my best to arrest him on the spot. Likewise, if I were an alleged taxi union thug who was going to rough up the driver, yet for some reason didn’t do so immediately when he showed up, being kicked out of the car is not going to help your situation any.