If you look at it this way, reverse screening is just as legal as primary checkpoint screening:
Upon entering a checkpoint, you have given implied consent to have your luggage searched while in the sterile area.
Now, you have not left the sterile area until you have reached your destination and picked up your baggage in the public area.
You have went from one airport's sterile area to another. Along the way, you were aboard the aircraft which is "sterile", as well.