Don't know for sure the exact circumstances of the reason pulled aside but some things to keep in mind:
1. When traveling to Canada, Canadian law requires that all pax passports be rechecked before boarding. Specific to that country.
2. If we don't see DOCs ok on a boarding pass we have to make sure that you are clear to enter that country. Remember that the GA is your exit Immigration officer from the US.
3. We ask to see your passport or have it out so that we and you know that you have it with you. Easier to take a minute of your time when boarding vs sending you on a roundtrip to SYD and back because you misplaced your passport in the US.
4. Not all agents work international flights. We may send you back to get checked as we don't have all the world passports and visa requirements for all countries memorized.
5. If you have a paper boarding pass make sure someone on the boarding pass it states DOCs Ok.
Hope these help to answer some of the questions to why we do what we do at the gate.