The TSA has all of your travel data before you fly. They compare who they think you are against their error-prone No Fly List, which denies people the right to travel without any due process hearing.
So it’s strange in a way that they need your boarding pass when you go through security. Once you’ve identified yourself they can match your ID to their secure flight database and they already know your travel plans.